50,523
社区成员
发帖
与我相关
我的任务
分享
InputStream in = new FileInputStream(new File("D:\\1.jpg"));
FileOutputStream fileOut = new FileOutputStream(new File(
"D:\\2.jpg"));
byte[] buf = new byte[1024 * 8];
while (true) {
int read = 0;
if (in != null) {
read = in.read(buf);
}
System.out.println(read);
if (read == -1) {
break;
}
fileOut.write(buf, 0, read);
}
fileOut.flush();