FileInputStream fis = new FileInputStream("1.gif");
byte[] by = new byte[1024];
int len = 0;
while ((len = fis.read(by))!=-1)
{
fos.write(by,0,len);
}
BufferedInputStream bis = new BufferedInputStream(new FileInputStream("1.gif"));
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("copy1.gif"));
byte[] by = new byte[1024];
int len =0;
while ((len =bis.read(by))!=-1)
{
// bos.write(len);犯错
bos.write(by,0,len);
}
bis.close();
bos.close();作者: itpower 时间: 2014-3-17 22:09
BufferedInputStream是套在某个其他的InputStream外,起着缓存的功能,