Class FS.StreamGobbler

  • All Implemented Interfaces:
    java.lang.Runnable
    Enclosing class:
    FS

    private static class FS.StreamGobbler
    extends java.lang.Object
    implements java.lang.Runnable
    This runnable will consume an input stream's content into an output stream as soon as it gets available.

    Typically used to empty processes' standard output and error, preventing them to choke.

    Note that a FS.StreamGobbler will never close either of its streams.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.io.InputStream in  
      private java.io.OutputStream out  
    • Constructor Summary

      Constructors 
      Constructor Description
      StreamGobbler​(java.io.InputStream stream, java.io.OutputStream output)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void copy()  
      void run()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • in

        private java.io.InputStream in
      • out

        private java.io.OutputStream out
    • Constructor Detail

      • StreamGobbler

        public StreamGobbler​(java.io.InputStream stream,
                             java.io.OutputStream output)
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • copy

        void copy()
           throws java.io.IOException
        Throws:
        java.io.IOException