了解,开发中不用
若要COPY请使用BufferedInputStream/BufferedOutputStream 或 FileInputStream/FileOutputStream
实现
public class Test02SystemInOutForCopy {public static void main(String[] args) throws IOException {//改变标准输入流System.setIn(new FileInputStream(".\\005IO流\\test.jpg"));//改变标准输出流System.setOut(new PrintStream(".\\005IO流\\test_system.jpg"));InputStream is = System.in;PrintStream ps = System.out;byte[] arr = new byte[1024];int len;while((len = is.read(arr)) != -1) {ps.write(arr, 0, len);}is.close();ps.close();}}
