Class BufferedReadChannel

  • Direct Known Subclasses:
    BufferedChannel

    public class BufferedReadChannel
    extends BufferedChannelBase
    A Buffered channel without a write buffer. Only reads are buffered.
    • Field Detail

      • readCapacity

        protected final int readCapacity
      • readBuffer

        protected final io.netty.buffer.ByteBuf readBuffer
      • readBufferStartPosition

        protected long readBufferStartPosition
      • invocationCount

        long invocationCount
      • cacheHitCount

        long cacheHitCount
    • Constructor Detail

      • BufferedReadChannel

        public BufferedReadChannel​(java.nio.channels.FileChannel fileChannel,
                                   int readCapacity)
    • Method Detail

      • read

        public int read​(io.netty.buffer.ByteBuf dest,
                        long pos)
                 throws java.io.IOException
        Read as many bytes into dest as dest.capacity() starting at position pos in the FileChannel. This function can read from the buffer or the file channel depending on the implementation..
        Parameters:
        dest -
        pos -
        Returns:
        The total number of bytes read. -1 if the given position is greater than or equal to the file's current size.
        Throws:
        java.io.IOException - if I/O error occurs
      • read

        public int read​(io.netty.buffer.ByteBuf dest,
                        long pos,
                        int length)
                 throws java.io.IOException
        Throws:
        java.io.IOException
      • clear

        public void clear()