Class NettyArrowBuf

java.lang.Object
io.netty.buffer.ByteBuf
io.netty.buffer.AbstractByteBuf
io.netty.buffer.NettyArrowBuf
All Implemented Interfaces:
io.netty.buffer.ByteBufConvertible, io.netty.util.ReferenceCounted, AutoCloseable, Comparable<io.netty.buffer.ByteBuf>

public class NettyArrowBuf extends io.netty.buffer.AbstractByteBuf implements AutoCloseable
Netty specific wrapper over ArrowBuf for use in Netty framework.
  • Constructor Summary

    Constructors
    Constructor
    Description
    NettyArrowBuf(ArrowBuf arrowBuf, BufferAllocator bufferAllocator, int length)
    Constructs a new instance.
  • Method Summary

    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
     
    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)
     
    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)
     
     
    byte[]
     
    int
     
     
    int
     
    io.netty.buffer.ByteBuf
    capacity(int newCapacity)
     
    void
     
    io.netty.buffer.ByteBuf
     
    io.netty.buffer.ByteBuf
    copy(int index, int length)
     
    byte
    getByte(int index)
     
    io.netty.buffer.ByteBuf
    getBytes(int index, byte[] dst, int dstIndex, int length)
     
    io.netty.buffer.ByteBuf
    getBytes(int index, io.netty.buffer.ByteBuf dst, int dstIndex, int length)
     
    io.netty.buffer.ByteBuf
    getBytes(int index, OutputStream out, int length)
     
    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)
     
    int
    getInt(int index)
     
    long
    getLong(int index)
     
    short
    getShort(int index)
     
    boolean
     
    boolean
     
    internalNioBuffer(int index, int length)
     
    boolean
     
    long
     
     
    nioBuffer(int index, int length)
    Returns a buffer that is zero positioned but points to a slice of the original buffer starting at given index.
    nioBuffer(long index, int length)
    Returns a buffer that is zero positioned but points to a slice of the original buffer starting at given index.
    int
     
     
    nioBuffers(int index, int length)
     
     
    io.netty.buffer.ByteBuf
    order(ByteOrder endianness)
     
    readerIndex(int readerIndex)
     
    int
     
    boolean
     
    boolean
    release(int decrement)
     
    io.netty.buffer.ByteBuf
     
    io.netty.buffer.ByteBuf
    retain(int increment)
     
    setByte(int index, int value)
     
    io.netty.buffer.ByteBuf
    setBytes(int index, byte[] src, int srcIndex, int length)
     
    io.netty.buffer.ByteBuf
    setBytes(int index, io.netty.buffer.ByteBuf src, int srcIndex, int length)
     
    int
    setBytes(int index, InputStream in, int length)
     
    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)
     
    setInt(int index, int value)
     
    setLong(int index, long value)
     
    setMedium(int index, int value)
     
    setShort(int index, int value)
     
     
    slice(int index, int length)
     
    io.netty.buffer.ByteBuf
     
    io.netty.buffer.ByteBuf
    touch(Object hint)
     
    io.netty.buffer.ByteBuf
     
    unwrap arrow buffer into a netty buffer.
    writerIndex(int writerIndex)
     

    Methods inherited from class io.netty.buffer.AbstractByteBuf

    adjustMarkers, asReadOnly, bytesBefore, bytesBefore, bytesBefore, checkDstIndex, checkDstIndex, checkIndex, checkIndex, checkNewCapacity, checkReadableBytes, checkSrcIndex, clear, compareTo, discardReadBytes, discardSomeReadBytes, duplicate, ensureAccessible, ensureWritable, ensureWritable, equals, forEachByte, forEachByte, forEachByteDesc, forEachByteDesc, getBoolean, getBytes, getBytes, getBytes, getChar, getCharSequence, getDouble, getFloat, getIntLE, getLongLE, getMedium, getMediumLE, getShortLE, getUnsignedByte, getUnsignedInt, getUnsignedIntLE, getUnsignedMedium, getUnsignedMediumLE, getUnsignedShort, getUnsignedShortLE, hashCode, indexOf, isReadable, isReadable, isReadOnly, isWritable, isWritable, markReaderIndex, markWriterIndex, maxCapacity, maxCapacity, maxWritableBytes, newSwappedByteBuf, readableBytes, readBoolean, readByte, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readChar, readCharSequence, readDouble, 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, setBytes, setBytes, setBytes, setChar, setCharSequence, setDouble, setFloat, setIndex, setIntLE, setLongLE, setMediumLE, setShortLE, setZero, skipBytes, toString, 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, writeShort, writeShortLE, writeZero

    Methods inherited from class io.netty.buffer.ByteBuf

    asByteBuf, getDoubleLE, getFloatLE, isContiguous, maxFastWritableBytes, readDoubleLE, readFloatLE, setDoubleLE, setFloatLE, writeDoubleLE, writeFloatLE

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • NettyArrowBuf

      public NettyArrowBuf(ArrowBuf arrowBuf, BufferAllocator bufferAllocator, int length)
      Constructs a new instance.
      Parameters:
      arrowBuf - The buffer to wrap.
      bufferAllocator - The allocator for the buffer.
      length - The length of this buffer.
  • Method Details

    • copy

      public io.netty.buffer.ByteBuf copy()
      Overrides:
      copy in class io.netty.buffer.AbstractByteBuf
    • copy

      public io.netty.buffer.ByteBuf copy(int index, int length)
      Specified by:
      copy in class io.netty.buffer.ByteBuf
    • retain

      public io.netty.buffer.ByteBuf retain()
      Specified by:
      retain in interface io.netty.util.ReferenceCounted
      Specified by:
      retain in class io.netty.buffer.ByteBuf
    • arrowBuf

      public ArrowBuf arrowBuf()
    • retain

      public io.netty.buffer.ByteBuf retain(int increment)
      Specified by:
      retain in interface io.netty.util.ReferenceCounted
      Specified by:
      retain in class io.netty.buffer.ByteBuf
    • isDirect

      public boolean isDirect()
      Specified by:
      isDirect in class io.netty.buffer.ByteBuf
    • capacity

      public io.netty.buffer.ByteBuf capacity(int newCapacity)
      Specified by:
      capacity in class io.netty.buffer.ByteBuf
    • unwrap

      public io.netty.buffer.ByteBuf unwrap()
      Specified by:
      unwrap in class io.netty.buffer.ByteBuf
    • refCnt

      public int refCnt()
      Specified by:
      refCnt in interface io.netty.util.ReferenceCounted
    • alloc

      public ArrowByteBufAllocator alloc()
      Specified by:
      alloc in class io.netty.buffer.ByteBuf
    • hasArray

      public boolean hasArray()
      Specified by:
      hasArray in class io.netty.buffer.ByteBuf
    • array

      public byte[] array()
      Specified by:
      array in class io.netty.buffer.ByteBuf
    • arrayOffset

      public int arrayOffset()
      Specified by:
      arrayOffset in class io.netty.buffer.ByteBuf
    • hasMemoryAddress

      public boolean hasMemoryAddress()
      Specified by:
      hasMemoryAddress in class io.netty.buffer.ByteBuf
    • memoryAddress

      public long memoryAddress()
      Specified by:
      memoryAddress in class io.netty.buffer.ByteBuf
    • touch

      public io.netty.buffer.ByteBuf touch()
      Specified by:
      touch in interface io.netty.util.ReferenceCounted
      Specified by:
      touch in class io.netty.buffer.ByteBuf
    • touch

      public io.netty.buffer.ByteBuf touch(Object hint)
      Specified by:
      touch in interface io.netty.util.ReferenceCounted
      Specified by:
      touch in class io.netty.buffer.ByteBuf
    • capacity

      public int capacity()
      Specified by:
      capacity in class io.netty.buffer.ByteBuf
    • slice

      public NettyArrowBuf slice()
      Overrides:
      slice in class io.netty.buffer.AbstractByteBuf
    • slice

      public NettyArrowBuf slice(int index, int length)
      Overrides:
      slice in class io.netty.buffer.AbstractByteBuf
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • release

      public boolean release()
      Specified by:
      release in interface io.netty.util.ReferenceCounted
    • release

      public boolean release(int decrement)
      Specified by:
      release in interface io.netty.util.ReferenceCounted
    • readerIndex

      public NettyArrowBuf readerIndex(int readerIndex)
      Overrides:
      readerIndex in class io.netty.buffer.AbstractByteBuf
    • writerIndex

      public NettyArrowBuf writerIndex(int writerIndex)
      Overrides:
      writerIndex in class io.netty.buffer.AbstractByteBuf
    • nioBufferCount

      public int nioBufferCount()
      Specified by:
      nioBufferCount in class io.netty.buffer.ByteBuf
    • internalNioBuffer

      public ByteBuffer internalNioBuffer(int index, int length)
      Specified by:
      internalNioBuffer in class io.netty.buffer.ByteBuf
    • nioBuffers

      public ByteBuffer[] nioBuffers()
      Overrides:
      nioBuffers in class io.netty.buffer.AbstractByteBuf
    • nioBuffers

      public ByteBuffer[] nioBuffers(int index, int length)
      Specified by:
      nioBuffers in class io.netty.buffer.ByteBuf
    • nioBuffer

      public ByteBuffer nioBuffer()
      Overrides:
      nioBuffer in class io.netty.buffer.AbstractByteBuf
    • nioBuffer

      public ByteBuffer nioBuffer(int index, int length)
      Returns a buffer that is zero positioned but points to a slice of the original buffer starting at given index.
      Specified by:
      nioBuffer in class io.netty.buffer.ByteBuf
    • nioBuffer

      public ByteBuffer nioBuffer(long index, int length)
      Returns a buffer that is zero positioned but points to a slice of the original buffer starting at given index.
    • getBytes

      public io.netty.buffer.ByteBuf getBytes(int index, ByteBuffer dst)
      Specified by:
      getBytes in class io.netty.buffer.ByteBuf
    • setBytes

      public io.netty.buffer.ByteBuf setBytes(int index, ByteBuffer src)
      Specified by:
      setBytes in class io.netty.buffer.ByteBuf
    • getBytes

      public io.netty.buffer.ByteBuf getBytes(int index, byte[] dst, int dstIndex, int length)
      Specified by:
      getBytes in class io.netty.buffer.ByteBuf
    • setBytes

      public io.netty.buffer.ByteBuf setBytes(int index, byte[] src, int srcIndex, int length)
      Specified by:
      setBytes in class io.netty.buffer.ByteBuf
    • getBytes

      public io.netty.buffer.ByteBuf getBytes(int index, io.netty.buffer.ByteBuf dst, int dstIndex, int length)
      Specified by:
      getBytes in class io.netty.buffer.ByteBuf
    • setBytes

      public io.netty.buffer.ByteBuf setBytes(int index, io.netty.buffer.ByteBuf src, int srcIndex, int length)
      Specified by:
      setBytes in class io.netty.buffer.ByteBuf
    • getBytes

      public io.netty.buffer.ByteBuf getBytes(int index, OutputStream out, int length) throws IOException
      Specified by:
      getBytes in class io.netty.buffer.ByteBuf
      Throws:
      IOException
    • setBytes

      public int setBytes(int index, InputStream in, int length) throws IOException
      Specified by:
      setBytes in class io.netty.buffer.ByteBuf
      Throws:
      IOException
    • getBytes

      public int getBytes(int index, GatheringByteChannel out, int length) throws IOException
      Specified by:
      getBytes in class 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 io.netty.buffer.ByteBuf
      Throws:
      IOException
    • setBytes

      public int setBytes(int index, ScatteringByteChannel in, int length) throws IOException
      Specified by:
      setBytes in class 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 io.netty.buffer.ByteBuf
      Throws:
      IOException
    • order

      public ByteOrder order()
      Specified by:
      order in class io.netty.buffer.ByteBuf
    • order

      public io.netty.buffer.ByteBuf order(ByteOrder endianness)
      Overrides:
      order in class io.netty.buffer.AbstractByteBuf
    • _getUnsignedMedium

      protected int _getUnsignedMedium(int index)
      Specified by:
      _getUnsignedMedium in class io.netty.buffer.AbstractByteBuf
    • _getUnsignedMediumLE

      protected int _getUnsignedMediumLE(int index)
      Specified by:
      _getUnsignedMediumLE in class io.netty.buffer.AbstractByteBuf
    • _getByte

      protected byte _getByte(int index)
      Specified by:
      _getByte in class io.netty.buffer.AbstractByteBuf
    • getByte

      public byte getByte(int index)
      Overrides:
      getByte in class io.netty.buffer.AbstractByteBuf
    • _getShortLE

      protected short _getShortLE(int index)
      Specified by:
      _getShortLE in class io.netty.buffer.AbstractByteBuf
    • _getShort

      protected short _getShort(int index)
      Specified by:
      _getShort in class io.netty.buffer.AbstractByteBuf
    • getShort

      public short getShort(int index)
      Overrides:
      getShort in class io.netty.buffer.AbstractByteBuf
    • _getIntLE

      protected int _getIntLE(int index)
      Specified by:
      _getIntLE in class io.netty.buffer.AbstractByteBuf
    • _getInt

      protected int _getInt(int index)
      Specified by:
      _getInt in class io.netty.buffer.AbstractByteBuf
    • getInt

      public int getInt(int index)
      Overrides:
      getInt in class io.netty.buffer.AbstractByteBuf
    • _getLongLE

      protected long _getLongLE(int index)
      Specified by:
      _getLongLE in class io.netty.buffer.AbstractByteBuf
    • _getLong

      protected long _getLong(int index)
      Specified by:
      _getLong in class io.netty.buffer.AbstractByteBuf
    • getLong

      public long getLong(int index)
      Overrides:
      getLong in class io.netty.buffer.AbstractByteBuf
    • _setByte

      protected void _setByte(int index, int value)
      Specified by:
      _setByte in class io.netty.buffer.AbstractByteBuf
    • setByte

      public NettyArrowBuf setByte(int index, int value)
      Overrides:
      setByte in class io.netty.buffer.AbstractByteBuf
    • _setShortLE

      protected void _setShortLE(int index, int value)
      Specified by:
      _setShortLE in class io.netty.buffer.AbstractByteBuf
    • _setShort

      protected void _setShort(int index, int value)
      Specified by:
      _setShort in class io.netty.buffer.AbstractByteBuf
    • setShort

      public NettyArrowBuf setShort(int index, int value)
      Overrides:
      setShort in class io.netty.buffer.AbstractByteBuf
    • _setMedium

      protected void _setMedium(int index, int value)
      Specified by:
      _setMedium in class io.netty.buffer.AbstractByteBuf
    • _setMediumLE

      protected void _setMediumLE(int index, int value)
      Specified by:
      _setMediumLE in class io.netty.buffer.AbstractByteBuf
    • setMedium

      public NettyArrowBuf setMedium(int index, int value)
      Overrides:
      setMedium in class io.netty.buffer.AbstractByteBuf
    • _setInt

      protected void _setInt(int index, int value)
      Specified by:
      _setInt in class io.netty.buffer.AbstractByteBuf
    • _setIntLE

      protected void _setIntLE(int index, int value)
      Specified by:
      _setIntLE in class io.netty.buffer.AbstractByteBuf
    • setInt

      public NettyArrowBuf setInt(int index, int value)
      Overrides:
      setInt in class io.netty.buffer.AbstractByteBuf
    • _setLong

      protected void _setLong(int index, long value)
      Specified by:
      _setLong in class io.netty.buffer.AbstractByteBuf
    • _setLongLE

      public void _setLongLE(int index, long value)
      Specified by:
      _setLongLE in class io.netty.buffer.AbstractByteBuf
    • setLong

      public NettyArrowBuf setLong(int index, long value)
      Overrides:
      setLong in class io.netty.buffer.AbstractByteBuf
    • unwrapBuffer

      public static NettyArrowBuf unwrapBuffer(ArrowBuf buf)
      unwrap arrow buffer into a netty buffer.