Package edu.rit.io

Class Stdio

java.lang.Object
edu.rit.io.Stdio

public class Stdio extends Object
Class Stdio provides standard I/O streams that can be redirected on a per-thread basis.
Version:
08-Oct-2010
Author:
Alan Kaminsky
  • Method Details

    • in

      public static InputStream in()
      Get the standard input stream for the calling thread.
      Returns:
      Standard input stream.
    • out

      public static PrintStream out()
      Get the standard output stream for the calling thread.
      Returns:
      Standard output stream.
    • err

      public static PrintStream err()
      Get the standard error stream for the calling thread.
      Returns:
      Standard error stream.
    • in

      public static void in(InputStream stream)
      Set the standard input stream for the calling thread. If not set, the default is System.in.
      Parameters:
      stream - Standard input stream.
      Throws:
      NullPointerException - (unchecked exception) Thrown if stream is null.
    • out

      public static void out(PrintStream stream)
      Set the standard output stream for the calling thread. If not set, the default is System.out.
      Parameters:
      stream - Standard output stream.
      Throws:
      NullPointerException - (unchecked exception) Thrown if stream is null.
    • err

      public static void err(PrintStream stream)
      Set the standard error stream for the calling thread. If not set, the default is System.err.
      Parameters:
      stream - Standard error stream.
      Throws:
      NullPointerException - (unchecked exception) Thrown if stream is null.