- package day10;
- import java.io.*;
- public class Test001 {
- public static void main(String[] args) throws IOException {
- //创建高效字节流读取数据
- BufferedInputStream bis = new BufferedInputStream(new FileInputStream("C:\\IMG_3444.JPG"));
- //创建高效字节流写入数据
- BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("D:\\jape.jpg"));
- byte[] by =new byte[1024];
- int line;
- while ((line = bis.read(by))!=-1){
- bos.write(by,0,line);
- }
- bos.close();
- bis.close();
- }
- }
复制代码 |
|