package chap10.sec03;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
public class Demo6 {
public static void stream() throws Exception{
InputStream in=new FileInputStream("d:/测试文件.txt");
OutputStream out=new FileOutputStream("e:/复制的文件.txt");
int b=0;
while((b=in.read())!=-1){
out.write(b);
}
in.close();
out.close();
}
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
stream();
}
}
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
public class Demo6 {
public static void stream() throws Exception{
InputStream in=new FileInputStream("d:/测试文件.txt");
OutputStream out=new FileOutputStream("e:/复制的文件.txt");
int b=0;
while((b=in.read())!=-1){
out.write(b);
}
in.close();
out.close();
}
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
stream();
}
}