新增 支持Content Uri编辑脚本

This commit is contained in:
hyb1996
2018-10-24 17:55:19 +08:00
parent cd71a7e1dd
commit dbcb0257a2
8 changed files with 89 additions and 24 deletions

View File

@@ -136,6 +136,8 @@ public class PFiles {
return new String(bytes, encoding);
} catch (IOException e) {
throw new UncheckedIOException(e);
} finally {
closeSilently(is);
}
}
@@ -218,7 +220,7 @@ public class PFiles {
}
}
public static void write(FileOutputStream fileOutputStream, String text) {
public static void write(OutputStream fileOutputStream, String text) {
write(fileOutputStream, text, "utf-8");
}
@@ -226,9 +228,10 @@ public class PFiles {
public static void write(OutputStream outputStream, String text, String encoding) {
try {
outputStream.write(text.getBytes(encoding));
outputStream.close();
} catch (IOException e) {
throw new UncheckedIOException(e);
} finally {
closeSilently(outputStream);
}
}