Class NonBlockingPumpInputStream

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

    public class NonBlockingPumpInputStream
    extends NonBlockingInputStream
    • Field Detail

      • readBuffer

        private final java.nio.ByteBuffer readBuffer
      • writeBuffer

        private final java.nio.ByteBuffer writeBuffer
      • output

        private final java.io.OutputStream output
      • closed

        private boolean closed
      • ioException

        private java.io.IOException ioException
    • Constructor Detail

      • NonBlockingPumpInputStream

        public NonBlockingPumpInputStream()
      • NonBlockingPumpInputStream

        public NonBlockingPumpInputStream​(int bufferSize)
    • Method Detail

      • getOutputStream

        public java.io.OutputStream getOutputStream()
      • wait

        private int wait​(java.nio.ByteBuffer buffer,
                         long timeout)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • rewind

        private static boolean rewind​(java.nio.ByteBuffer buffer,
                                      java.nio.ByteBuffer other)
      • available

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

        public int read​(long timeout,
                        boolean isPeek)
                 throws java.io.IOException
        Specified by:
        read 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
      • write

        void write​(byte[] cbuf,
                   int off,
                   int len)
            throws java.io.IOException
        Throws:
        java.io.IOException
      • flush

        void flush()
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.InputStream
        Throws:
        java.io.IOException