import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.IOException; public class BufferedReaderDemo { public static void main(String[] args) { /* A BufferedStreamReader has a readLine method, which reads until it encounters '\n', '\r', or '\n\r'. */ InputStreamReader reader = new InputStreamReader(System.in); BufferedReader breader = new BufferedReader(reader); try { String s; while ((s = breader.readLine()) != null) { System.out.println(s); } } catch (IOException e) { System.err.println(e.getMessage()); } } }