Class NonBlockingPumpInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class NonBlockingPumpInputStream
    extends NonBlockingInputStream
    • Constructor Detail

      • NonBlockingPumpInputStream

        public NonBlockingPumpInputStream()
      • NonBlockingPumpInputStream

        public NonBlockingPumpInputStream​(int bufferSize)
    • Method Detail

      • getOutputStream

        public java.io.OutputStream getOutputStream()
      • available

        public int available()
        Overrides:
        available in class java.io.InputStream
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class NonBlockingInputStream
        Throws:
        java.io.IOException
      • read

        public int read​(long timeout,
                        boolean isPeek)
                 throws java.io.IOException
        Specified by:
        read in class NonBlockingInputStream
        Throws:
        java.io.IOException
      • readBuffered

        public int readBuffered​(byte[] b,
                                int off,
                                int len,
                                long timeout)
                         throws java.io.IOException
        Overrides:
        readBuffered in class NonBlockingInputStream
        Throws:
        java.io.IOException
      • setIoException

        public void setIoException​(java.io.IOException exception)
      • checkIoException

        protected void checkIoException()
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • closeWriter

        public void closeWriter()
        Signals that the write side has been closed and no more data will be written. Any buffered data can still be read; reads will return NonBlockingInputStream.EOF only after all buffered data has been consumed. This is analogous to closing the write end of a Unix pipe: the read end drains remaining data before seeing EOF.
      • close

        public void close()
                   throws java.io.IOException
        Description copied from class: NonBlockingInputStream
        Closes this input stream and marks it as closed.

        Subsequent read operations behavior depends on the PROP_CLOSE_MODE setting:

        • "strict" - Throw ClosedException (default in JLine 4.x)
        • "warn" - Log a warning but continue (default in JLine 3.x)
        • "lenient" - Silently allow access
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class NonBlockingInputStream
        Throws:
        java.io.IOException - if an I/O error occurs