import java.io.*;
class IOTest
{
public static void main(String[] args) throws Exception
{
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("F:\\TestJava\\IO流\\FileInputStream和FileOutputStream\\瑞安家园设计方案专题.jpg"));
BufferedInputStream bis = new BufferedInputStream(new FileInputStream("E:\\Users\\lin\\Pictures\\Camera Roll\\瑞安家园设计方案专题.jpg"));
byte[] bytes = new byte[1024];
int len = 0;
while((len=bis.read(bytes))!=-1)
{
bos.write(bytes,0,len);
}
System.out.println("复制成功");
bis.close();
bos.close();
}
}
|
|