byte []data = new byte[1];
File sf = new File("C:
Users
you
Desktop
423880618.txt");
File df = new File("C:
Users
you
Desktop
4.txt");
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(sf));
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(df));
while(bis.read(data) != -1)
{
bos.write(data);
}
BufferedInputStream与BufferedOutputStream都有一个buf的位数组,写入和读取数据时都默认先经过buf,
那为什么还要显式的定义一个byte []data = new byte[1];然后bis.read(data) 和bos.write(data)?
|