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

private static class TextFromStandardInputStream.SystemInMock extends InputStream
  • Field Details

  • Constructor Details

    • SystemInMock

      private SystemInMock()
  • Method Details

    • provideText

      void provideText(String text)
    • throwExceptionOnInputEnd

      void throwExceptionOnInputEnd(IOException exception)
    • throwExceptionOnInputEnd

      void throwExceptionOnInputEnd(RuntimeException exception)
    • read

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

      private void handleEmptyReader() throws IOException
      Throws:
      IOException
    • read

      public int read(byte[] buffer, int offset, int len) throws IOException
      Overrides:
      read in class InputStream
      Throws:
      IOException
    • readNextLine

      private int readNextLine(byte[] buffer, int offset, int len) throws IOException
      Throws:
      IOException
    • isCompleteLineWritten

      private boolean isCompleteLineWritten(byte[] buffer, int indexLastByteWritten)
    • contains

      private boolean contains(byte[] array, byte[] pattern, int indexStart)