import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import org.omg.Messaging.SyncScopeHelper;
public class test_2 {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
// 练习 修改标准输入流 和 输出流 完成图片拷贝
System.setIn(new FileInputStream("风景.jpg")); //改变System.in的输入的源头为“风景。jpg”
System.setOut(new PrintStream(("copy.jpg"))); //改变System.out的目的地为“copy.jpg”
InputStream in = System.in;
PrintStream out = System.out;
int len;
byte[] arr = new byte[1024];
while((len = in.read(arr))!=-1)
{
out.write(arr,0,len);
}
in.close();
out.close();
}
}