Class WritableBufferedChannel

    • Constructor Detail

      • WritableBufferedChannel

        public WritableBufferedChannel​(Buffer buffer,
                                       WritableSelectionChannel target,
                                       WakeupListener wakeupListener)
        Deprecated.
        Constructor.
        Parameters:
        buffer - The source byte buffer, typically remaining from previous read processing.
        target - The target 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.
      • onDrain

        public final 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 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
      • write

        public int write​(java.nio.ByteBuffer sourceBuffer)
                  throws java.io.IOException
        Deprecated.
        Reads some bytes and put them into the destination buffer. The bytes come from the underlying channel.
        Specified by:
        write in interface java.nio.channels.WritableByteChannel
        Parameters:
        sourceBuffer - The source buffer.
        Returns:
        The number of bytes written, possibly 0.
        Throws:
        java.io.IOException