IO Write file from stream

This commit is contained in:
Daniel Mills 2021-07-20 04:48:15 -04:00
parent 5ed9a29f81
commit 53b7f33ec4

View File

@ -327,6 +327,13 @@ public class IO {
pw.close(); pw.close();
} }
public static void writeAll(File f, OutputStream c) throws IOException {
f.getParentFile().mkdirs();
FileInputStream in = new FileInputStream(f);
IO.fullTransfer(in, c, 8192);
in.close();
}
public static String readAll(File f) throws IOException { public static String readAll(File f) throws IOException {
FileReader fr; FileReader fr;
try { try {