public class Demo_BufferedInputStream {
/**
* 标准IO字节流
* @throws IOException
*/
public static void main(String[] args) throws IOException {
BufferedInputStream bis = new BufferedInputStream(new FileInputStream("D:\\1024.mp4"));
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("copy.mp4"));
byte[] bys = new byte[1024];
int len;
while((len = bis.read(bys)) != -1) {
bos.write(bys,0,len);
}
bis.close();
bos.close();
}
}
|