Class NonBlockingPumpReader

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

    public class NonBlockingPumpReader
    extends NonBlockingReader
    • Constructor Detail

      • NonBlockingPumpReader

        public NonBlockingPumpReader()
      • NonBlockingPumpReader

        public NonBlockingPumpReader​(int bufferSize)
    • Method Detail

      • getWriter

        public java.io.Writer getWriter()
      • ready

        public boolean ready()
        Overrides:
        ready in class java.io.Reader
      • read

        protected int read​(long timeout,
                           boolean isPeek)
                    throws java.io.IOException
        Description copied from class: NonBlockingReader
        Attempts to read a character from the input stream for a specific period of time.
        Specified by:
        read in class NonBlockingReader
        Parameters:
        timeout - The amount of time to wait for the character
        isPeek - trueif the character read must not be consumed
        Returns:
        The character read, -1 if EOF is reached, or -2 if the read timed out.
        Throws:
        java.io.IOException - if anything wrong happens
      • readBuffered

        public int readBuffered​(char[] b,
                                int off,
                                int len,
                                long timeout)
                         throws java.io.IOException
        Specified by:
        readBuffered in class NonBlockingReader
        Throws:
        java.io.IOException
      • close

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