Package io.netty.buffer
Class ExpandableByteBuf
java.lang.Object
io.netty.buffer.ByteBuf
io.netty.buffer.AbstractByteBuf
io.netty.buffer.ExpandableByteBuf
- All Implemented Interfaces:
io.netty.buffer.ByteBufConvertible
,io.netty.util.ReferenceCounted
,Comparable<io.netty.buffer.ByteBuf>
public class ExpandableByteBuf
extends io.netty.buffer.AbstractByteBuf
Allows us to decorate ArrowBuf to make it expandable so that we can use them in the context of
the Netty framework (thus supporting RPC level memory accounting).
-
Constructor Summary
ConstructorDescriptionExpandableByteBuf
(io.netty.buffer.ByteBuf buffer, BufferAllocator allocator) -
Method Summary
Modifier and TypeMethodDescriptionprotected 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) io.netty.buffer.ByteBufAllocator
alloc()
byte[]
array()
int
int
capacity()
io.netty.buffer.ByteBuf
capacity
(int newCapacity) io.netty.buffer.ByteBuf
copy
(int index, int length) int
forEachByte
(int index, int length, io.netty.util.ByteProcessor processor) int
forEachByteDesc
(int index, int length, io.netty.util.ByteProcessor processor) 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) int
getIntLE
(int index) long
getLong
(int index) long
getLongLE
(int index) short
getShort
(int index) short
getShortLE
(int index) int
getUnsignedMedium
(int index) int
getUnsignedMediumLE
(int index) boolean
hasArray()
boolean
internalNioBuffer
(int index, int length) boolean
isDirect()
long
nioBuffer
(int index, int length) int
nioBuffers
(int index, int length) order()
final int
refCnt()
boolean
release()
boolean
release
(int decrement) final io.netty.buffer.ByteBuf
retain()
final io.netty.buffer.ByteBuf
retain
(int increment) io.netty.buffer.ByteBuf
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) io.netty.buffer.ByteBuf
setInt
(int index, int value) io.netty.buffer.ByteBuf
setIntLE
(int index, int value) io.netty.buffer.ByteBuf
setLong
(int index, long value) io.netty.buffer.ByteBuf
setLongLE
(int index, long value) io.netty.buffer.ByteBuf
setMedium
(int index, int value) io.netty.buffer.ByteBuf
setMediumLE
(int index, int value) io.netty.buffer.ByteBuf
setShort
(int index, int value) io.netty.buffer.ByteBuf
setShortLE
(int index, int value) io.netty.buffer.ByteBuf
slice
(int index, int length) final io.netty.buffer.ByteBuf
touch()
final io.netty.buffer.ByteBuf
io.netty.buffer.ByteBuf
unwrap()
Methods inherited from class 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, forEachByteDesc, getBoolean, getBytes, getBytes, getBytes, getChar, getCharSequence, getDouble, getFloat, getMedium, getMediumLE, getUnsignedByte, getUnsignedInt, getUnsignedIntLE, 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, 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, setBytes, setBytes, setBytes, setChar, setCharSequence, setDouble, setFloat, setIndex, setZero, skipBytes, slice, 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, writerIndex, writeShort, writeShortLE, writeZero
Methods inherited from class io.netty.buffer.ByteBuf
asByteBuf, getDoubleLE, getFloatLE, isContiguous, maxFastWritableBytes, readDoubleLE, readFloatLE, setDoubleLE, setFloatLE, writeDoubleLE, writeFloatLE
-
Constructor Details
-
ExpandableByteBuf
-
-
Method Details
-
copy
public io.netty.buffer.ByteBuf copy(int index, int length) -
capacity
public io.netty.buffer.ByteBuf capacity(int newCapacity) -
nioBuffer
- Specified by:
nioBuffer
in classio.netty.buffer.ByteBuf
-
unwrap
public io.netty.buffer.ByteBuf unwrap()- Specified by:
unwrap
in classio.netty.buffer.ByteBuf
-
alloc
public io.netty.buffer.ByteBufAllocator alloc()- Specified by:
alloc
in classio.netty.buffer.ByteBuf
-
order
- Specified by:
order
in classio.netty.buffer.ByteBuf
-
isDirect
public boolean isDirect()- Specified by:
isDirect
in classio.netty.buffer.ByteBuf
-
capacity
public int capacity()- Specified by:
capacity
in classio.netty.buffer.ByteBuf
-
hasArray
public boolean hasArray()- Specified by:
hasArray
in classio.netty.buffer.ByteBuf
-
array
public byte[] array()- Specified by:
array
in classio.netty.buffer.ByteBuf
-
arrayOffset
public int arrayOffset()- Specified by:
arrayOffset
in classio.netty.buffer.ByteBuf
-
hasMemoryAddress
public boolean hasMemoryAddress()- Specified by:
hasMemoryAddress
in classio.netty.buffer.ByteBuf
-
memoryAddress
public long memoryAddress()- Specified by:
memoryAddress
in classio.netty.buffer.ByteBuf
-
getByte
public byte getByte(int index) - Overrides:
getByte
in classio.netty.buffer.AbstractByteBuf
-
_getByte
protected byte _getByte(int index) - Specified by:
_getByte
in classio.netty.buffer.AbstractByteBuf
-
getShort
public short getShort(int index) - Overrides:
getShort
in classio.netty.buffer.AbstractByteBuf
-
_getShort
protected short _getShort(int index) - Specified by:
_getShort
in classio.netty.buffer.AbstractByteBuf
-
getShortLE
public short getShortLE(int index) - Overrides:
getShortLE
in classio.netty.buffer.AbstractByteBuf
-
_getShortLE
protected short _getShortLE(int index) - Specified by:
_getShortLE
in classio.netty.buffer.AbstractByteBuf
-
getUnsignedMedium
public int getUnsignedMedium(int index) - Overrides:
getUnsignedMedium
in classio.netty.buffer.AbstractByteBuf
-
_getUnsignedMedium
protected int _getUnsignedMedium(int index) - Specified by:
_getUnsignedMedium
in classio.netty.buffer.AbstractByteBuf
-
getUnsignedMediumLE
public int getUnsignedMediumLE(int index) - Overrides:
getUnsignedMediumLE
in classio.netty.buffer.AbstractByteBuf
-
_getUnsignedMediumLE
protected int _getUnsignedMediumLE(int index) - Specified by:
_getUnsignedMediumLE
in classio.netty.buffer.AbstractByteBuf
-
getInt
public int getInt(int index) - Overrides:
getInt
in classio.netty.buffer.AbstractByteBuf
-
_getInt
protected int _getInt(int index) - Specified by:
_getInt
in classio.netty.buffer.AbstractByteBuf
-
getIntLE
public int getIntLE(int index) - Overrides:
getIntLE
in classio.netty.buffer.AbstractByteBuf
-
_getIntLE
protected int _getIntLE(int index) - Specified by:
_getIntLE
in classio.netty.buffer.AbstractByteBuf
-
getLong
public long getLong(int index) - Overrides:
getLong
in classio.netty.buffer.AbstractByteBuf
-
_getLong
protected long _getLong(int index) - Specified by:
_getLong
in classio.netty.buffer.AbstractByteBuf
-
getLongLE
public long getLongLE(int index) - Overrides:
getLongLE
in classio.netty.buffer.AbstractByteBuf
-
_getLongLE
protected long _getLongLE(int index) - Specified by:
_getLongLE
in classio.netty.buffer.AbstractByteBuf
-
slice
public io.netty.buffer.ByteBuf slice(int index, int length) - Overrides:
slice
in classio.netty.buffer.AbstractByteBuf
-
getBytes
public io.netty.buffer.ByteBuf getBytes(int index, io.netty.buffer.ByteBuf dst, int dstIndex, int length) - Specified by:
getBytes
in classio.netty.buffer.ByteBuf
-
getBytes
public io.netty.buffer.ByteBuf getBytes(int index, byte[] dst, int dstIndex, int length) - Specified by:
getBytes
in classio.netty.buffer.ByteBuf
-
getBytes
- Specified by:
getBytes
in classio.netty.buffer.ByteBuf
-
setByte
public io.netty.buffer.ByteBuf setByte(int index, int value) - Overrides:
setByte
in classio.netty.buffer.AbstractByteBuf
-
_setByte
protected void _setByte(int index, int value) - Specified by:
_setByte
in classio.netty.buffer.AbstractByteBuf
-
setShort
public io.netty.buffer.ByteBuf setShort(int index, int value) - Overrides:
setShort
in classio.netty.buffer.AbstractByteBuf
-
_setShort
protected void _setShort(int index, int value) - Specified by:
_setShort
in classio.netty.buffer.AbstractByteBuf
-
setShortLE
public io.netty.buffer.ByteBuf setShortLE(int index, int value) - Overrides:
setShortLE
in classio.netty.buffer.AbstractByteBuf
-
_setShortLE
protected void _setShortLE(int index, int value) - Specified by:
_setShortLE
in classio.netty.buffer.AbstractByteBuf
-
setMedium
public io.netty.buffer.ByteBuf setMedium(int index, int value) - Overrides:
setMedium
in classio.netty.buffer.AbstractByteBuf
-
_setMedium
protected void _setMedium(int index, int value) - Specified by:
_setMedium
in classio.netty.buffer.AbstractByteBuf
-
setMediumLE
public io.netty.buffer.ByteBuf setMediumLE(int index, int value) - Overrides:
setMediumLE
in classio.netty.buffer.AbstractByteBuf
-
_setMediumLE
protected void _setMediumLE(int index, int value) - Specified by:
_setMediumLE
in classio.netty.buffer.AbstractByteBuf
-
setInt
public io.netty.buffer.ByteBuf setInt(int index, int value) - Overrides:
setInt
in classio.netty.buffer.AbstractByteBuf
-
_setInt
protected void _setInt(int index, int value) - Specified by:
_setInt
in classio.netty.buffer.AbstractByteBuf
-
setIntLE
public io.netty.buffer.ByteBuf setIntLE(int index, int value) - Overrides:
setIntLE
in classio.netty.buffer.AbstractByteBuf
-
_setIntLE
protected void _setIntLE(int index, int value) - Specified by:
_setIntLE
in classio.netty.buffer.AbstractByteBuf
-
setLong
public io.netty.buffer.ByteBuf setLong(int index, long value) - Overrides:
setLong
in classio.netty.buffer.AbstractByteBuf
-
_setLong
protected void _setLong(int index, long value) - Specified by:
_setLong
in classio.netty.buffer.AbstractByteBuf
-
setLongLE
public io.netty.buffer.ByteBuf setLongLE(int index, long value) - Overrides:
setLongLE
in classio.netty.buffer.AbstractByteBuf
-
_setLongLE
protected void _setLongLE(int index, long value) - Specified by:
_setLongLE
in classio.netty.buffer.AbstractByteBuf
-
setBytes
public io.netty.buffer.ByteBuf setBytes(int index, byte[] src, int srcIndex, int length) - Specified by:
setBytes
in classio.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 classio.netty.buffer.ByteBuf
-
setBytes
- Specified by:
setBytes
in classio.netty.buffer.ByteBuf
-
setBytes
- Specified by:
setBytes
in classio.netty.buffer.ByteBuf
- Throws:
IOException
-
getBytes
- Specified by:
getBytes
in classio.netty.buffer.ByteBuf
- Throws:
IOException
-
getBytes
- Specified by:
getBytes
in classio.netty.buffer.ByteBuf
- Throws:
IOException
-
setBytes
- Specified by:
setBytes
in classio.netty.buffer.ByteBuf
- Throws:
IOException
-
setBytes
- Specified by:
setBytes
in classio.netty.buffer.ByteBuf
- Throws:
IOException
-
getBytes
- Specified by:
getBytes
in classio.netty.buffer.ByteBuf
- Throws:
IOException
-
nioBufferCount
public int nioBufferCount()- Specified by:
nioBufferCount
in classio.netty.buffer.ByteBuf
-
nioBuffers
- Specified by:
nioBuffers
in classio.netty.buffer.ByteBuf
-
internalNioBuffer
- Specified by:
internalNioBuffer
in classio.netty.buffer.ByteBuf
-
forEachByte
public int forEachByte(int index, int length, io.netty.util.ByteProcessor processor) - Overrides:
forEachByte
in classio.netty.buffer.AbstractByteBuf
-
forEachByteDesc
public int forEachByteDesc(int index, int length, io.netty.util.ByteProcessor processor) - Overrides:
forEachByteDesc
in classio.netty.buffer.AbstractByteBuf
-
refCnt
public final int refCnt() -
touch
public final io.netty.buffer.ByteBuf touch()- Specified by:
touch
in interfaceio.netty.util.ReferenceCounted
- Specified by:
touch
in classio.netty.buffer.ByteBuf
-
touch
- Specified by:
touch
in interfaceio.netty.util.ReferenceCounted
- Specified by:
touch
in classio.netty.buffer.ByteBuf
-
retain
public final io.netty.buffer.ByteBuf retain()- Specified by:
retain
in interfaceio.netty.util.ReferenceCounted
- Specified by:
retain
in classio.netty.buffer.ByteBuf
-
retain
public final io.netty.buffer.ByteBuf retain(int increment) - Specified by:
retain
in interfaceio.netty.util.ReferenceCounted
- Specified by:
retain
in classio.netty.buffer.ByteBuf
-
release
public boolean release() -
release
public boolean release(int decrement)
-