62,614
社区成员
发帖
与我相关
我的任务
分享
public class ByteStreamDemo {
public static void main(String args) throws IOException{
FileInputStream fip = new FileInputStream("f:\\123.mp3");
FileOutputStream fop = new FileOutputStream("f:\\WRITER\\123.mp3");
byte[] buf = new byte[1024];
int i = 0;
while((i=fip.read(buf))!=-1){
fop.write(buf,0,i);
}
fip.close();
fop.close();
}
}
public class TestCopyJpg {
public static void main(String[] args) throws IOException{
FileInputStream fip = new FileInputStream("c:\\a.JPG");
FileOutputStream fop = new FileOutputStream("d:\\a.JPG");
byte[] buf = new byte[1024];
int i = 0;
while((i=fip.read(buf))!=-1){
fop.write(buf,0,i);
}
fip.close();
fop.close();
}
}