Class StdIn

java.lang.Object
java.io.InputStream
org.junitpioneer.jupiter.StdIn
All Implemented Interfaces:
Closeable, AutoCloseable

public class StdIn extends InputStream
For details and examples, see the documentation on standard input/output.
See Also:
  • Field Details

    • reader

      private final StringReader reader
    • writer

      private final StringWriter writer
    • availableBytes

      private int availableBytes
      Keeps track of number of bytes that are still available to read().
  • Constructor Details

    • StdIn

      public StdIn(String[] lines)
  • Method Details

    • available

      public int available() throws IOException
      Overrides:
      available in class InputStream
      Throws:
      IOException
    • read

      public int read() throws IOException
      Specified by:
      read in class InputStream
      Throws:
      IOException
    • read

      public int read(byte[] b, int off, int len) throws IOException
      Overrides:
      read in class InputStream
      Throws:
      IOException
    • capturedString

      public String capturedString()
      Returns:
      the string that was read from System.in; note that buffering readers may read all lines eagerly
    • capturedLines

      public String[] capturedLines()
      Returns:
      the lines that were read from System.in; note that buffering readers may read all lines eagerly