System.setIn(new FileInputStream("IO图片.png")); //改变标准输入流
System.setOut(new PrintStream("copy.png")); //改变标准输出流
InputStream is = System.in; //获取标准输入流
PrintStream ps = System.out; //获取标准输出流
int len;
byte[] arr = new byte[1024 * 8];
while((len = is.read(arr)) != -1) {
ps.write(arr, 0, len);
}
is.close();
ps.close(); |
|