//完成DataInputStream 和DataOutputStream 完成复制 package work; import java.io.*; public class data { public static void main(String[] args) throws IOException { DataInputStream dr = new DataInputStream(new FileInputStream("H:\\a.txt"));//输入流 DataOutputStream dm = new DataOutputStream(new FileOutputStream("H:\\Text.txt"));//输出流 int a = 0 ; byte[] b = new byte[1024]; while ((a = dr.read(b))!=-1){//循环遍历 dm.write(b); dm.flush(); } dr.close(); dm.close(); } }
09-16
2085