public class Test {
public static void main(String[] args) throws Throwable {
File file = new File("C:\\Users\\Administrator\\Desktop\\123.jpg");
File file2 = new File("C:\\Users\\Administrator\\Desktop\\123_4.jpg");
System.out.println("Started:");
InputStream in = new FileInputStream(file);
OutputStream out = new FileOutputStream(file2);
byte[] tempbytes = new byte[1024];
while (in.available() > 0) {
int read = in.read(tempbytes, 0, tempbytes.length);
System.out.println(read);
out.write(tempbytes, 0, read);
}
out.close();
in.close();
System.out.println("ended:");
}
}
?