import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class demo7 {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
PopyImage();
}
public static void PopyImage() {
long time1 = System.currentTimeMillis();
//找路径
File file = new File("C:\\Users\\zhangheng\\Desktop\\d9cf11161c4ed2ad.jpg");
//输入流 通道
FileInputStream fileInputStream = null;
try {
fileInputStream = new FileInputStream(file);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// 缓冲区
byte[] by =new byte[1024];
// 读取数据
int count =0;
//图片的路径
java字节输入流和输出流拷贝图片
最新推荐文章于 2024-05-30 23:37:17 发布