Class NetworkBuffer

  • All Implemented Interfaces:
    Comparable<org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf>, Buffer, org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufConvertible, org.apache.flink.shaded.netty4.io.netty.util.ReferenceCounted

    public class NetworkBuffer
    extends org.apache.flink.shaded.netty4.io.netty.buffer.AbstractReferenceCountedByteBuf
    implements Buffer
    Wrapper for pooled MemorySegment instances.

    NOTE: before using this buffer in the netty stack, a buffer allocator must be set via setAllocator(ByteBufAllocator)!

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.apache.flink.runtime.io.network.buffer.Buffer

        Buffer.DataType
    • Constructor Summary

      Constructors 
      Constructor Description
      NetworkBuffer​(org.apache.flink.core.memory.MemorySegment memorySegment, BufferRecycler recycler)
      Creates a new buffer instance backed by the given memorySegment with 0 for the readerIndex and writerIndex.
      NetworkBuffer​(org.apache.flink.core.memory.MemorySegment memorySegment, BufferRecycler recycler, Buffer.DataType dataType)
      Creates a new buffer instance backed by the given memorySegment with 0 for the readerIndex and writerIndex.
      NetworkBuffer​(org.apache.flink.core.memory.MemorySegment memorySegment, BufferRecycler recycler, Buffer.DataType dataType, boolean isCompressed, int size)
      Creates a new buffer instance backed by the given memorySegment with 0 for the readerIndex and size as writerIndex.
      NetworkBuffer​(org.apache.flink.core.memory.MemorySegment memorySegment, BufferRecycler recycler, Buffer.DataType dataType, int size)
      Creates a new buffer instance backed by the given memorySegment with 0 for the readerIndex and size as writerIndex.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected byte _getByte​(int index)  
      protected int _getInt​(int index)  
      protected int _getIntLE​(int index)  
      protected long _getLong​(int index)  
      protected long _getLongLE​(int index)  
      protected short _getShort​(int index)  
      protected short _getShortLE​(int index)  
      protected int _getUnsignedMedium​(int index)  
      protected int _getUnsignedMediumLE​(int index)  
      protected void _setByte​(int index, int value)  
      protected void _setInt​(int index, int value)  
      protected void _setIntLE​(int index, int value)  
      protected void _setLong​(int index, long value)  
      protected void _setLongLE​(int index, long value)  
      protected void _setMedium​(int index, int value)  
      protected void _setMediumLE​(int index, int value)  
      protected void _setShort​(int index, int value)  
      protected void _setShortLE​(int index, int value)  
      org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufAllocator alloc()  
      byte[] array()  
      int arrayOffset()  
      org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf asByteBuf()  
      int capacity()  
      org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf capacity​(int newCapacity)  
      org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf copy​(int index, int length)  
      protected void deallocate()  
      org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf getBytes​(int index, byte[] dst, int dstIndex, int length)  
      org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf getBytes​(int index, OutputStream out, int length)  
      org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf getBytes​(int index, ByteBuffer dst)  
      int getBytes​(int index, FileChannel out, long position, int length)  
      int getBytes​(int index, GatheringByteChannel out, int length)  
      org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf getBytes​(int index, org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf dst, int dstIndex, int length)  
      Buffer.DataType getDataType()
      Gets the type of data this buffer represents.
      int getMaxCapacity()
      Returns the maximum size of the buffer, i.e. the capacity of the underlying MemorySegment.
      org.apache.flink.core.memory.MemorySegment getMemorySegment()
      Returns the underlying memory segment.
      int getMemorySegmentOffset()
      This method will be removed in the future.
      ByteBuffer getNioBuffer​(int index, int length)
      Gets a new ByteBuffer instance wrapping this buffer's bytes.
      ByteBuffer getNioBufferReadable()
      Gets a new ByteBuffer instance wrapping this buffer's readable bytes, i.e. between Buffer.getReaderIndex() and Buffer.getSize().
      int getReaderIndex()
      Returns the reader index of this buffer.
      BufferRecycler getRecycler()
      Gets the buffer's recycler.
      int getSize()
      Returns the size of the written data, i.e. the writer index, of this buffer.
      boolean hasArray()  
      boolean hasMemoryAddress()  
      ByteBuffer internalNioBuffer​(int index, int length)  
      boolean isBuffer()
      Returns whether this buffer represents a buffer or an event.
      boolean isCompressed()  
      boolean isDirect()  
      boolean isRecycled()
      Returns whether this buffer has been recycled or not.
      long memoryAddress()  
      ByteBuffer nioBuffer​(int index, int length)  
      int nioBufferCount()  
      ByteBuffer[] nioBuffers​(int index, int length)  
      ByteOrder order()  
      org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf readBytes​(int length)  
      ReadOnlySlicedNetworkBuffer readOnlySlice()
      Returns a read-only slice of this buffer's readable bytes, i.e. between Buffer.getReaderIndex() and Buffer.getSize().
      ReadOnlySlicedNetworkBuffer readOnlySlice​(int index, int length)
      Returns a read-only slice of this buffer.
      void recycleBuffer()
      Releases this buffer once, i.e. reduces the reference count and recycles the buffer if the reference count reaches 0.
      NetworkBuffer retainBuffer()
      Retains this buffer for further use, increasing the reference counter by 1.
      void setAllocator​(org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufAllocator allocator)
      Sets the buffer allocator for use in netty.
      org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf setBytes​(int index, byte[] src, int srcIndex, int length)  
      int setBytes​(int index, InputStream in, int length)  
      org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf setBytes​(int index, ByteBuffer src)  
      int setBytes​(int index, FileChannel in, long position, int length)  
      int setBytes​(int index, ScatteringByteChannel in, int length)  
      org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf setBytes​(int index, org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf src, int srcIndex, int length)  
      void setCompressed​(boolean isCompressed)
      Tags the buffer as compressed or uncompressed.
      void setDataType​(Buffer.DataType dataType)
      Sets the type of data this buffer represents.
      void setReaderIndex​(int readerIndex)
      Sets the reader index of this buffer.
      void setRecycler​(BufferRecycler bufferRecycler)
      Sets the buffer's recycler.
      void setSize​(int writerIndex)
      Sets the size of the written data, i.e. the writer index, of this buffer.
      String toString()  
      org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf unwrap()  
      • Methods inherited from class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractReferenceCountedByteBuf

        refCnt, release, release, resetRefCnt, retain, retain, setRefCnt, touch, touch
      • Methods inherited from class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBuf

        adjustMarkers, asReadOnly, bytesBefore, bytesBefore, bytesBefore, checkDstIndex, checkDstIndex, checkIndex, checkIndex, checkNewCapacity, checkReadableBytes, checkSrcIndex, clear, compareTo, copy, discardReadBytes, discardSomeReadBytes, duplicate, ensureAccessible, ensureWritable, ensureWritable, equals, forEachByte, forEachByte, forEachByteDesc, forEachByteDesc, getBoolean, getByte, getBytes, getBytes, getBytes, getChar, getCharSequence, getDouble, getFloat, getInt, getIntLE, getLong, getLongLE, getMedium, getMediumLE, getShort, getShortLE, getUnsignedByte, getUnsignedInt, getUnsignedIntLE, getUnsignedMedium, getUnsignedMediumLE, getUnsignedShort, getUnsignedShortLE, hashCode, indexOf, isReadable, isReadable, isReadOnly, isWritable, isWritable, markReaderIndex, markWriterIndex, maxCapacity, maxCapacity, maxWritableBytes, newSwappedByteBuf, nioBuffer, nioBuffers, order, readableBytes, readBoolean, readByte, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readChar, readCharSequence, readDouble, readerIndex, readerIndex, readFloat, readInt, readIntLE, readLong, readLongLE, readMedium, readMediumLE, readRetainedSlice, readShort, readShortLE, readSlice, readUnsignedByte, readUnsignedInt, readUnsignedIntLE, readUnsignedMedium, readUnsignedMediumLE, readUnsignedShort, readUnsignedShortLE, resetReaderIndex, resetWriterIndex, retainedDuplicate, retainedSlice, retainedSlice, setBoolean, setByte, setBytes, setBytes, setBytes, setChar, setCharSequence, setDouble, setFloat, setIndex, setInt, setIntLE, setLong, setLongLE, setMedium, setMediumLE, setShort, setShortLE, setZero, skipBytes, slice, slice, toString, toString, trimIndicesToCapacity, writableBytes, writeBoolean, writeByte, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeChar, writeCharSequence, writeDouble, writeFloat, writeInt, writeIntLE, writeLong, writeLongLE, writeMedium, writeMediumLE, writerIndex, writerIndex, writeShort, writeShortLE, writeZero
      • Methods inherited from class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf

        getDoubleLE, getFloatLE, isContiguous, maxFastWritableBytes, readDoubleLE, readFloatLE, setDoubleLE, setFloatLE, writeDoubleLE, writeFloatLE
    • Constructor Detail

      • NetworkBuffer

        public NetworkBuffer​(org.apache.flink.core.memory.MemorySegment memorySegment,
                             BufferRecycler recycler)
        Creates a new buffer instance backed by the given memorySegment with 0 for the readerIndex and writerIndex.
        Parameters:
        memorySegment - backing memory segment (defines AbstractByteBuf.maxCapacity)
        recycler - will be called to recycle this buffer once the reference count is 0
      • NetworkBuffer

        public NetworkBuffer​(org.apache.flink.core.memory.MemorySegment memorySegment,
                             BufferRecycler recycler,
                             Buffer.DataType dataType)
        Creates a new buffer instance backed by the given memorySegment with 0 for the readerIndex and writerIndex.
        Parameters:
        memorySegment - backing memory segment (defines AbstractByteBuf.maxCapacity)
        recycler - will be called to recycle this buffer once the reference count is 0
        dataType - the Buffer.DataType this buffer represents
      • NetworkBuffer

        public NetworkBuffer​(org.apache.flink.core.memory.MemorySegment memorySegment,
                             BufferRecycler recycler,
                             Buffer.DataType dataType,
                             int size)
        Creates a new buffer instance backed by the given memorySegment with 0 for the readerIndex and size as writerIndex.
        Parameters:
        memorySegment - backing memory segment (defines AbstractByteBuf.maxCapacity)
        recycler - will be called to recycle this buffer once the reference count is 0
        dataType - the Buffer.DataType this buffer represents
        size - current size of data in the buffer, i.e. the writer index to set
      • NetworkBuffer

        public NetworkBuffer​(org.apache.flink.core.memory.MemorySegment memorySegment,
                             BufferRecycler recycler,
                             Buffer.DataType dataType,
                             boolean isCompressed,
                             int size)
        Creates a new buffer instance backed by the given memorySegment with 0 for the readerIndex and size as writerIndex.
        Parameters:
        memorySegment - backing memory segment (defines AbstractByteBuf.maxCapacity)
        recycler - will be called to recycle this buffer once the reference count is 0
        dataType - the Buffer.DataType this buffer represents
        size - current size of data in the buffer, i.e. the writer index to set
        isCompressed - whether the buffer is compressed or not
    • Method Detail

      • isBuffer

        public boolean isBuffer()
        Description copied from interface: Buffer
        Returns whether this buffer represents a buffer or an event.
        Specified by:
        isBuffer in interface Buffer
        Returns:
        true if this is a real buffer, false if this is an event
      • getMemorySegment

        public org.apache.flink.core.memory.MemorySegment getMemorySegment()
        Description copied from interface: Buffer
        Returns the underlying memory segment. This method is dangerous since it ignores read only protections and omits slices. Use it only along the Buffer.getMemorySegmentOffset().

        This method will be removed in the future. For writing use BufferBuilder.

        Specified by:
        getMemorySegment in interface Buffer
        Returns:
        the memory segment backing this buffer
      • getMemorySegmentOffset

        public int getMemorySegmentOffset()
        Description copied from interface: Buffer
        This method will be removed in the future. For writing use BufferBuilder.
        Specified by:
        getMemorySegmentOffset in interface Buffer
        Returns:
        the offset where this (potential slice) Buffer's data start in the underlying memory segment.
      • getRecycler

        public BufferRecycler getRecycler()
        Description copied from interface: Buffer
        Gets the buffer's recycler.
        Specified by:
        getRecycler in interface Buffer
        Returns:
        buffer recycler
      • setRecycler

        public void setRecycler​(BufferRecycler bufferRecycler)
        Description copied from interface: Buffer
        Sets the buffer's recycler.

        Note that updating the recycler is an unsafe operation and this method cannot guarantee thread safety. It is important for the caller to fully understand the consequences of calling this method. Incorrectly updating the buffer recycler can result in a leak of the buffer due to using a wrong recycler to recycle buffer. Therefore, be careful when calling this method.

        Specified by:
        setRecycler in interface Buffer
        Parameters:
        bufferRecycler - the new buffer recycler
      • recycleBuffer

        public void recycleBuffer()
        Description copied from interface: Buffer
        Releases this buffer once, i.e. reduces the reference count and recycles the buffer if the reference count reaches 0.
        Specified by:
        recycleBuffer in interface Buffer
        See Also:
        Buffer.retainBuffer()
      • isRecycled

        public boolean isRecycled()
        Description copied from interface: Buffer
        Returns whether this buffer has been recycled or not.
        Specified by:
        isRecycled in interface Buffer
        Returns:
        true if already recycled, false otherwise
      • retainBuffer

        public NetworkBuffer retainBuffer()
        Description copied from interface: Buffer
        Retains this buffer for further use, increasing the reference counter by 1.
        Specified by:
        retainBuffer in interface Buffer
        Returns:
        this instance (for chained calls)
        See Also:
        Buffer.recycleBuffer()
      • readOnlySlice

        public ReadOnlySlicedNetworkBuffer readOnlySlice​(int index,
                                                         int length)
        Description copied from interface: Buffer
        Returns a read-only slice of this buffer.

        Reader and writer indices as well as markers are not shared. Reference counters are shared but the slice is not retained automatically.

        Specified by:
        readOnlySlice in interface Buffer
        Parameters:
        index - the index to start from
        length - the length of the slice
        Returns:
        a read-only sliced buffer
      • deallocate

        protected void deallocate()
        Specified by:
        deallocate in class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractReferenceCountedByteBuf
      • _getByte

        protected byte _getByte​(int index)
        Specified by:
        _getByte in class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBuf
      • _getShort

        protected short _getShort​(int index)
        Specified by:
        _getShort in class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBuf
      • _getShortLE

        protected short _getShortLE​(int index)
        Specified by:
        _getShortLE in class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBuf
      • _getUnsignedMedium

        protected int _getUnsignedMedium​(int index)
        Specified by:
        _getUnsignedMedium in class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBuf
      • _getUnsignedMediumLE

        protected int _getUnsignedMediumLE​(int index)
        Specified by:
        _getUnsignedMediumLE in class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBuf
      • _getInt

        protected int _getInt​(int index)
        Specified by:
        _getInt in class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBuf
      • _getIntLE

        protected int _getIntLE​(int index)
        Specified by:
        _getIntLE in class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBuf
      • _getLong

        protected long _getLong​(int index)
        Specified by:
        _getLong in class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBuf
      • _getLongLE

        protected long _getLongLE​(int index)
        Specified by:
        _getLongLE in class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBuf
      • _setByte

        protected void _setByte​(int index,
                                int value)
        Specified by:
        _setByte in class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBuf
      • _setShort

        protected void _setShort​(int index,
                                 int value)
        Specified by:
        _setShort in class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBuf
      • _setShortLE

        protected void _setShortLE​(int index,
                                   int value)
        Specified by:
        _setShortLE in class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBuf
      • _setMedium

        protected void _setMedium​(int index,
                                  int value)
        Specified by:
        _setMedium in class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBuf
      • _setMediumLE

        protected void _setMediumLE​(int index,
                                    int value)
        Specified by:
        _setMediumLE in class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBuf
      • _setInt

        protected void _setInt​(int index,
                               int value)
        Specified by:
        _setInt in class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBuf
      • _setIntLE

        protected void _setIntLE​(int index,
                                 int value)
        Specified by:
        _setIntLE in class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBuf
      • _setLong

        protected void _setLong​(int index,
                                long value)
        Specified by:
        _setLong in class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBuf
      • _setLongLE

        protected void _setLongLE​(int index,
                                  long value)
        Specified by:
        _setLongLE in class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBuf
      • capacity

        public int capacity()
        Specified by:
        capacity in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
      • getMaxCapacity

        public int getMaxCapacity()
        Description copied from interface: Buffer
        Returns the maximum size of the buffer, i.e. the capacity of the underlying MemorySegment.
        Specified by:
        getMaxCapacity in interface Buffer
        Returns:
        size of the buffer
      • getReaderIndex

        public int getReaderIndex()
        Description copied from interface: Buffer
        Returns the reader index of this buffer.

        This is where readable (unconsumed) bytes start in the backing memory segment.

        Specified by:
        getReaderIndex in interface Buffer
        Returns:
        reader index (from 0 (inclusive) to the size of the backing MemorySegment (inclusive))
      • getSize

        public int getSize()
        Description copied from interface: Buffer
        Returns the size of the written data, i.e. the writer index, of this buffer.

        This is where writable bytes start in the backing memory segment.

        Specified by:
        getSize in interface Buffer
        Returns:
        writer index (from 0 (inclusive) to the size of the backing MemorySegment (inclusive))
      • setSize

        public void setSize​(int writerIndex)
        Description copied from interface: Buffer
        Sets the size of the written data, i.e. the writer index, of this buffer.
        Specified by:
        setSize in interface Buffer
      • capacity

        public org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf capacity​(int newCapacity)
        Specified by:
        capacity in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
      • order

        public ByteOrder order()
        Specified by:
        order in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
      • unwrap

        public org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf unwrap()
        Specified by:
        unwrap in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
      • isDirect

        public boolean isDirect()
        Specified by:
        isDirect in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
      • getBytes

        public org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf getBytes​(int index,
                                                                               org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf dst,
                                                                               int dstIndex,
                                                                               int length)
        Specified by:
        getBytes in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
      • getBytes

        public org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf getBytes​(int index,
                                                                               byte[] dst,
                                                                               int dstIndex,
                                                                               int length)
        Specified by:
        getBytes in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
      • getBytes

        public org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf getBytes​(int index,
                                                                               ByteBuffer dst)
        Specified by:
        getBytes in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
      • getBytes

        public org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf getBytes​(int index,
                                                                               OutputStream out,
                                                                               int length)
                                                                        throws IOException
        Specified by:
        getBytes in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
        Throws:
        IOException
      • getBytes

        public int getBytes​(int index,
                            GatheringByteChannel out,
                            int length)
                     throws IOException
        Specified by:
        getBytes in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
        Throws:
        IOException
      • getBytes

        public int getBytes​(int index,
                            FileChannel out,
                            long position,
                            int length)
                     throws IOException
        Specified by:
        getBytes in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
        Throws:
        IOException
      • setBytes

        public org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf setBytes​(int index,
                                                                               org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf src,
                                                                               int srcIndex,
                                                                               int length)
        Specified by:
        setBytes in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
      • setBytes

        public org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf setBytes​(int index,
                                                                               byte[] src,
                                                                               int srcIndex,
                                                                               int length)
        Specified by:
        setBytes in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
      • setBytes

        public org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf setBytes​(int index,
                                                                               ByteBuffer src)
        Specified by:
        setBytes in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
      • setBytes

        public int setBytes​(int index,
                            InputStream in,
                            int length)
                     throws IOException
        Specified by:
        setBytes in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
        Throws:
        IOException
      • setBytes

        public int setBytes​(int index,
                            ScatteringByteChannel in,
                            int length)
                     throws IOException
        Specified by:
        setBytes in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
        Throws:
        IOException
      • setBytes

        public int setBytes​(int index,
                            FileChannel in,
                            long position,
                            int length)
                     throws IOException
        Specified by:
        setBytes in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
        Throws:
        IOException
      • alloc

        public org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufAllocator alloc()
        Specified by:
        alloc in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
      • setAllocator

        public void setAllocator​(org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufAllocator allocator)
        Description copied from interface: Buffer
        Sets the buffer allocator for use in netty.
        Specified by:
        setAllocator in interface Buffer
        Parameters:
        allocator - netty buffer allocator
      • copy

        public org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf copy​(int index,
                                                                           int length)
        Specified by:
        copy in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
      • readBytes

        public org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf readBytes​(int length)
        Overrides:
        readBytes in class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBuf
      • nioBufferCount

        public int nioBufferCount()
        Specified by:
        nioBufferCount in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
      • getNioBuffer

        public ByteBuffer getNioBuffer​(int index,
                                       int length)
        Description copied from interface: Buffer
        Gets a new ByteBuffer instance wrapping this buffer's bytes.

        Please note that neither read nor write index are updated by the returned buffer.

        Specified by:
        getNioBuffer in interface Buffer
        Returns:
        byte buffer sharing the contents of the underlying memory segment
        See Also:
        Buffer.getNioBufferReadable()
      • nioBuffer

        public ByteBuffer nioBuffer​(int index,
                                    int length)
        Specified by:
        nioBuffer in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
      • internalNioBuffer

        public ByteBuffer internalNioBuffer​(int index,
                                            int length)
        Specified by:
        internalNioBuffer in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
      • nioBuffers

        public ByteBuffer[] nioBuffers​(int index,
                                       int length)
        Specified by:
        nioBuffers in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
      • hasArray

        public boolean hasArray()
        Specified by:
        hasArray in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
      • array

        public byte[] array()
        Specified by:
        array in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
      • arrayOffset

        public int arrayOffset()
        Specified by:
        arrayOffset in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
      • hasMemoryAddress

        public boolean hasMemoryAddress()
        Specified by:
        hasMemoryAddress in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
      • memoryAddress

        public long memoryAddress()
        Specified by:
        memoryAddress in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
      • toString

        public String toString()
        Overrides:
        toString in class org.apache.flink.shaded.netty4.io.netty.buffer.AbstractByteBuf
      • asByteBuf

        public org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf asByteBuf()
        Specified by:
        asByteBuf in interface Buffer
        Specified by:
        asByteBuf in interface org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufConvertible
        Overrides:
        asByteBuf in class org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf
        Returns:
        self as ByteBuf implementation.
      • isCompressed

        public boolean isCompressed()
        Specified by:
        isCompressed in interface Buffer
        Returns:
        whether the buffer is compressed or not.
      • setCompressed

        public void setCompressed​(boolean isCompressed)
        Description copied from interface: Buffer
        Tags the buffer as compressed or uncompressed.
        Specified by:
        setCompressed in interface Buffer
      • setDataType

        public void setDataType​(Buffer.DataType dataType)
        Description copied from interface: Buffer
        Sets the type of data this buffer represents.
        Specified by:
        setDataType in interface Buffer