All Implemented Interfaces:
Runnable
Enclosing class:
ShellCommand

private static class ShellCommand.StreamConsumerextends I2PAppThread
Consumes stream data. Instances of this class, when given the STDOUT and STDERR input streams of a Runtime.exec() process for example, will prevent blocking during a Process.waitFor() loop and thereby allow the process to exit properly. This class makes no attempt to preserve the consumed data.
  • Field Details

    • bufferedReader

      private final BufferedReader bufferedReader
      The stream being consumed.
  • Constructor Details

    • StreamConsumer

      public StreamConsumer(InputStream inputStream)
      Reads a stream on its own thread.
      Parameters:
      inputStream - the stream to consume
  • Method Details

    • run

      public void run()
      Description copied from class: I2PThread
      Run the thread, catching and reporting OOM and other failures.
      Specified by:
      run in interface Runnable
      Overrides:
      run in class I2PThread