- java.lang.Object
-
- java.io.InputStream
-
- org.junitpioneer.jupiter.StdIn
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class StdIn extends java.io.InputStreamFor details and examples, see the documentation on standard input/output.- See Also:
StdIo
-
-
Field Summary
Fields Modifier and Type Field Description private intavailableBytesKeeps track of number of bytes that are still available toread().private java.io.StringReaderreaderprivate java.io.StringWriterwriter
-
Constructor Summary
Constructors Constructor Description StdIn(java.lang.String[] lines)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()java.lang.String[]capturedLines()java.lang.StringcapturedString()intread()intread(byte[] b, int off, int len)
-
-
-
Method Detail
-
available
public int available() throws java.io.IOException- Overrides:
availablein classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
capturedString
public java.lang.String capturedString()
- Returns:
- the string that was read from
System.in; note that buffering readers may read all lines eagerly
-
capturedLines
public java.lang.String[] capturedLines()
- Returns:
- the lines that were read from
System.in; note that buffering readers may read all lines eagerly
-
-