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 StringReader
private IOException
private RuntimeException
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
contains
(byte[] array, byte[] pattern, int indexStart) private void
private boolean
isCompleteLineWritten
(byte[] buffer, int indexLastByteWritten) (package private) void
provideText
(String text) int
read()
int
read
(byte[] buffer, int offset, int len) private int
readNextLine
(byte[] buffer, int offset, int len) (package private) void
throwExceptionOnInputEnd
(IOException exception) (package private) void
throwExceptionOnInputEnd
(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:
read
in classInputStream
- Throws:
IOException
-
handleEmptyReader
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
readNextLine
- Throws:
IOException
-
isCompleteLineWritten
private boolean isCompleteLineWritten(byte[] buffer, int indexLastByteWritten) -
contains
private boolean contains(byte[] array, byte[] pattern, int indexStart)
-