// CopyText.java -- read the standard input stream as text and copy to standard out import java.util.Scanner; /* * System.in (java.io.InputStream) is the standard input * System.out (java.io.PrintStream) is the standard output */ public final class CopyText { public static void main (final String[] args) { final Scanner stdin = new Scanner(System.in, "US-ASCII"); // Read the standard input stream line by line. while (stdin.hasNextLine()) { // There is another line in the input stream. final String line = stdin.nextLine(); // get the next line from input System.out.println(line); // write the line to output } } }