public class Demo04 {
public static void main(String[] args) throws IOException {
FileInputStream fileInputStream = new FileInputStream("C:\\Users\\雪芹\\Pictures\\Screenshots\\屏幕截图(1).png");
FileOutputStream fileOutputStream = new FileOutputStream("屏幕截图(1).png");
byte[]bytes=new byte[1024];
int by;
while ((by=fileInputStream.read(bytes))!=-1){
fileOutputStream.write(bytes,0,by);
}
fileOutputStream.close();
fileInputStream.close();
}
}