62,620
社区成员
发帖
与我相关
我的任务
分享
import java.io.*;
public class TestIO {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
//test1
try {
FileInputStream is = new FileInputStream("a.txt");
FileOutputStream os = new FileOutputStream("b.txt");
byte[] read = new byte[1000];
while(is.read(read)!=-1){
os.write(read, 0, read.length);
}
os.flush();
os.close();
is.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
write(byte[] buf,int offset,int len)
--不就是设置一个起始,和结束吗?
sos.write(baos.toByteArray(),start,end);