B
Berlin Brown
Is there anything wrong with this copy file code. Just seems I should
be doing something more? I dont need to worry about the max size of
the file or anything?
public static void copyFile(String fromFile, String toFile) {
BufferedInputStream bi = new BufferedInputStream(new
FileInputStream(new File(fromFile)));
BufferedOutputStream bo = new BufferedOutputStream(new
FileOutputStream(new File(toFile)));
while(true) {
byte l = bi.read();
if (l == -1)
break;
bo.write(l);
bo.close();
bi.close();
} /// end of the while ///
return;
} /// end of the method //
be doing something more? I dont need to worry about the max size of
the file or anything?
public static void copyFile(String fromFile, String toFile) {
BufferedInputStream bi = new BufferedInputStream(new
FileInputStream(new File(fromFile)));
BufferedOutputStream bo = new BufferedOutputStream(new
FileOutputStream(new File(toFile)));
while(true) {
byte l = bi.read();
if (l == -1)
break;
bo.write(l);
bo.close();
bi.close();
} /// end of the while ///
return;
} /// end of the method //