Class TextFromStandardInputStream.SystemInMock
java.lang.Object
java.io.InputStream
org.junit.contrib.java.lang.system.TextFromStandardInputStream.SystemInMock
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
TextFromStandardInputStream
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringReaderprivate IOExceptionprivate RuntimeException -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleancontains(byte[] array, byte[] pattern, int indexStart) private voidprivate booleanisCompleteLineWritten(byte[] buffer, int indexLastByteWritten) (package private) voidprovideText(String text) intread()intread(byte[] buffer, int offset, int len) private intreadNextLine(byte[] buffer, int offset, int len) (package private) voidthrowExceptionOnInputEnd(IOException exception) (package private) voidthrowExceptionOnInputEnd(RuntimeException exception) Methods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
currentReader
-
ioException
-
runtimeException
-
-
Constructor Details
-
SystemInMock
private SystemInMock()
-
-
Method Details
-
provideText
-
throwExceptionOnInputEnd
-
throwExceptionOnInputEnd
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
handleEmptyReader
- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
readNextLine
- Throws:
IOException
-
isCompleteLineWritten
private boolean isCompleteLineWritten(byte[] buffer, int indexLastByteWritten) -
contains
private boolean contains(byte[] array, byte[] pattern, int indexStart)
-