mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-07 14:45:41 +12:00
Fix buffer errors
This commit is contained in:
parent
13136c6686
commit
6757117e0d
1 changed files with 5 additions and 5 deletions
|
@ -64,16 +64,16 @@ public class FileUtils {
|
||||||
|
|
||||||
public static boolean createFile(String path, String name) {
|
public static boolean createFile(String path, String name) {
|
||||||
DocumentFile folder = parseFile(path);
|
DocumentFile folder = parseFile(path);
|
||||||
if (folder.findFile(name) != null)
|
if (folder.findFile(name) != null) {
|
||||||
return true;
|
folder.findFile(name).delete();
|
||||||
|
}
|
||||||
|
|
||||||
return folder.createFile("", name) != null;
|
return folder.createFile("", name) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean writeTextFile(String path, String name, String content) {
|
public static boolean writeTextFile(String path, String name, String content) {
|
||||||
try {
|
try {
|
||||||
if (!exists(path + "/" + name)) {
|
createFile(path, name);
|
||||||
createFile(path, name);
|
|
||||||
}
|
|
||||||
OutputStream stream = getOutputStream(path + "/" + name);
|
OutputStream stream = getOutputStream(path + "/" + name);
|
||||||
stream.write(content.getBytes(StandardCharsets.UTF_8));
|
stream.write(content.getBytes(StandardCharsets.UTF_8));
|
||||||
stream.flush();
|
stream.flush();
|
||||||
|
|
Loading…
Add table
Reference in a new issue