Class ReadableBufferedChannel

    • Field Detail

      • completionListener

        private final CompletionListener completionListener
        Deprecated.
        The completion callback.
      • endReached

        private volatile boolean endReached
        Deprecated.
        Indicates if the end of the channel has been reached.
    • Constructor Detail

      • ReadableBufferedChannel

        public ReadableBufferedChannel​(CompletionListener completionListener,
                                       Buffer buffer,
                                       ReadableSelectionChannel source,
                                       WakeupListener wakeupListener)
        Deprecated.
        Constructor.
        Parameters:
        completionListener - The listener to callback upon reading completion.
        buffer - The source byte buffer, typically remaining from previous read processing.
        source - The source channel.
        wakeupListener - The wakeup listener that will be notified.
    • Method Detail

      • couldDrain

        public boolean couldDrain​(Buffer buffer,
                                  java.lang.Object... args)
        Deprecated.
        Indicates if the buffer could be drained again.
        Parameters:
        buffer - The IO buffer to drain.
        args - The optional arguments to pass back to the callbacks.
        Returns:
        True if the buffer could be drained again.
      • couldFill

        public boolean couldFill​(Buffer buffer,
                                 java.lang.Object... args)
        Deprecated.
        Indicates if the buffer could be filled again.
        Specified by:
        couldFill in interface BufferProcessor
        Parameters:
        buffer - The IO buffer to fill.
        args - The optional arguments to pass back to the callbacks.
        Returns:
        True if the buffer could be filled again.
      • getCompletionListener

        private CompletionListener getCompletionListener()
        Deprecated.
        Returns the completion callback.
        Returns:
        The completion callback.
      • isEndReached

        protected boolean isEndReached()
        Deprecated.
        Indicates if the end of the channel has been reached.
        Returns:
        True if the end of the channel has been reached.
      • onDrain

        public int onDrain​(Buffer buffer,
                           int maxDrained,
                           java.lang.Object... args)
                    throws java.io.IOException
        Deprecated.
        Drains the byte buffer.
        Specified by:
        onDrain in interface BufferProcessor
        Parameters:
        buffer - The IO buffer to drain.
        maxDrained - The maximum number of bytes drained by this call.
        args - The optional arguments to pass back to the callbacks.
        Returns:
        The number of bytes drained.
        Throws:
        java.io.IOException
      • onFill

        public final int onFill​(Buffer buffer,
                                java.lang.Object... args)
                         throws java.io.IOException
        Deprecated.
        Fills the byte buffer by writing the current message.
        Specified by:
        onFill in interface BufferProcessor
        Parameters:
        buffer - The IO buffer to drain.
        args - The optional arguments to pass back to the callbacks.
        Returns:
        The number of bytes filled.
        Throws:
        java.io.IOException
      • onMessageCompleted

        public void onMessageCompleted​(boolean eofDetected)
                                throws java.io.IOException
        Deprecated.
        Callback invoked upon IO completion. Calls CompletionListener.onMessageCompleted(boolean) if the end has been reached.
        Specified by:
        onMessageCompleted in interface CompletionListener
        Parameters:
        eofDetected - Indicates if the end of network connection was detected.
        Throws:
        java.io.IOException
      • read

        public int read​(java.nio.ByteBuffer targetBuffer)
                 throws java.io.IOException
        Deprecated.
        Reads some bytes and put them into the destination buffer. The bytes come from the underlying channel.
        Specified by:
        read in interface java.nio.channels.ReadableByteChannel
        Parameters:
        targetBuffer - The target buffer.
        Returns:
        The number of bytes read, or -1 if the end of the channel has been reached.
        Throws:
        java.io.IOException
      • setEndReached

        protected void setEndReached​(boolean endReached)
                              throws java.io.IOException
        Deprecated.
        Indicates if the end of the channel has been reached.
        Parameters:
        endReached - True if the end of the channel has been reached.
        Throws:
        java.io.IOException