标签:创建 file day stat throw tst while ring ati
package com.day17.IO;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class ArrayCopyStandard {
public static void main(String[] args) throws IOException {
FileInputStream fis=new FileInputStream("桌面背景.jpg");
FileOutputStream fos=new FileOutputStream("桌面背景copy.jpg");
byte[] arr=new byte[1024*8];//创建两个字节的数组
int len;
while((len=fis.read(arr))!=-1) {//这是两个两个字节的度,比原来的快一倍
fos.write(arr,0,len);//从0索引处开始写,长度为len
}
fis.close();
fos.close();
}
}
标签:创建 file day stat throw tst while ring ati
原文地址:https://www.cnblogs.com/zhujialei123/p/9129620.html