黑马程序员技术交流社区
标题:
【成都效区Javaee24期】
[打印本页]
作者:
yshshe1700
时间:
2019-4-3 22:20
标题:
【成都效区Javaee24期】
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();
}
}
复制代码
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/)
黑马程序员IT技术论坛 X3.2