package io;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* 将 System.in包装成BufferedReader
* System.in是一个InputStream,所以需要先用InputStreamReader将InputStream包装成Reader
* 然后再用BufferedReader包装
*/
public class TestReadWriteTxtFile
{
public static void main(String[] args) throws IOException
{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String s;
System.out.println("按回车结束程序!");
while( (s=in.readLine()) !=null && s.length() !=0)
{
System.out.println(s);
}
}
}