1.字节流读数据的标准代码
int read; while ((read = fio.read())!=-1){ System.out.print((char)read); }
2. 字节流一次读写一个数组
byte[] bytes = new byte[1024];//1024 及其整数倍 int len; while ((len = fio.read(bytes))!=-1){ System.out.println(new String(bytes,0,len)); }
1.字节流读数据的标准代码
int read; while ((read = fio.read())!=-1){ System.out.print((char)read); }
2. 字节流一次读写一个数组
byte[] bytes = new byte[1024];//1024 及其整数倍 int len; while ((len = fio.read(bytes))!=-1){ System.out.println(new String(bytes,0,len)); }