Top Description Inners Fields Constructors Methods
io.netty.buffer

pack-priv final Class FixedCompositeByteBuf

extends AbstractReferenceCountedByteBuf
Class Inheritance
Imports
io.netty.util.internal.EmptyArrays, .RecyclableArrayList, java.io.IOException, .InputStream, .OutputStream, java.nio.ByteBuffer, .ByteOrder, .ReadOnlyBufferException, java.nio.channels.FileChannel, .GatheringByteChannel, .ScatteringByteChannel, java.util.Collections

ByteBuf implementation which allows to wrap an array of ByteBuf in a read-only mode. This is useful to write an array of ByteBufs.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final ByteBufAllocator
private final ByteBuf[]
private final int
private final boolean
private static final ByteBuf[]
private final int
private final ByteOrder

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected byte
_getByte(int index)

Implements abstract io.netty.buffer.AbstractByteBuf._getByte.

protected int
_getInt(int index)

Implements abstract io.netty.buffer.AbstractByteBuf._getInt.

protected int
protected long
_getLong(int index)

Implements abstract io.netty.buffer.AbstractByteBuf._getLong.

protected long
protected short
protected short
protected int
protected int
protected void
_setByte(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setByte.

protected void
_setInt(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setInt.

protected void
_setIntLE(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setIntLE.

protected void
_setLong(int index, long value)

Implements abstract io.netty.buffer.AbstractByteBuf._setLong.

protected void
_setLongLE(int index, long value)

Implements abstract io.netty.buffer.AbstractByteBuf._setLongLE.

protected void
_setMedium(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setMedium.

protected void
_setMediumLE(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setMediumLE.

protected void
_setShort(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setShort.

protected void
_setShortLE(int index, int value)

Implements abstract io.netty.buffer.AbstractByteBuf._setShortLE.

public ByteBufAllocator
alloc()

Implements abstract io.netty.buffer.ByteBuf.alloc.

Returns the ByteBufAllocator which created this buffer.
public byte[]
array()

Implements abstract io.netty.buffer.ByteBuf.array.

Returns the backing byte array of this buffer.
public int
arrayOffset()

Implements abstract io.netty.buffer.ByteBuf.arrayOffset.

Returns the offset of the first byte within the backing byte array of this buffer.
private ByteBuf
buffer(int i)

Return the ByteBuf stored at the given index of the array.

public int
capacity()

Implements abstract io.netty.buffer.ByteBuf.capacity.

Returns the number of bytes (octets) this buffer can contain.
public ByteBuf
capacity(int newCapacity)

Implements abstract io.netty.buffer.ByteBuf.capacity.

Adjusts the capacity of this buffer.
public ByteBuf
copy(int index, int length)

Implements abstract io.netty.buffer.ByteBuf.copy.

Returns a copy of this buffer's sub-region.
protected void
public ByteBuf
discardReadBytes()

Overrides io.netty.buffer.AbstractByteBuf.discardReadBytes.

Discards the bytes between the 0th index and readerIndex.
private FixedCompositeByteBuf.Component
findComponent(int index)

public byte
getByte(int index)

Overrides io.netty.buffer.AbstractByteBuf.getByte.

Gets a byte at the specified absolute index in this buffer.
public ByteBuf
getBytes(int index, byte[] dst, int
the first index of the destination
dstIndex
,
int
the number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data to the specified destination starting at the specified absolute index.
public ByteBuf
getBytes(int index, ByteBuffer dst)

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data to the specified destination starting at the specified absolute index until the destination's position reaches its limit.
public ByteBuf
getBytes(int index, ByteBuf dst, int
the first index of the destination
dstIndex
,
int
the number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data to the specified destination starting at the specified absolute index.
public int
getBytes(int index, GatheringByteChannel out, int
the maximum number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data to the specified channel starting at the specified absolute index.
public int
getBytes(int index, FileChannel out, long
the file position at which the transfer is to begin
position
,
int
the maximum number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data starting at the specified absolute index to the specified channel starting at the given file position.
public ByteBuf
getBytes(int index, OutputStream out, int
the number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.getBytes.

Transfers this buffer's data to the specified stream starting at the specified absolute index.
public boolean
hasArray()

Implements abstract io.netty.buffer.ByteBuf.hasArray.

Returns true if and only if this buffer has a backing byte array.
public boolean
hasMemoryAddress()

Implements abstract io.netty.buffer.ByteBuf.hasMemoryAddress.

Returns true if and only if this buffer has a reference to the low-level memory address that points to the backing data.
public ByteBuffer
internalNioBuffer(int index, int length)

Implements abstract io.netty.buffer.ByteBuf.internalNioBuffer.

Internal use only: Exposes the internal NIO buffer.
public boolean
isDirect()

Implements abstract io.netty.buffer.ByteBuf.isDirect.

Returns true if and only if this buffer is backed by an NIO direct buffer.
public boolean
isWritable()

Overrides io.netty.buffer.AbstractByteBuf.isWritable.

Returns true if and only if (this.capacity - this.writerIndex) is greater than 0.
public boolean
isWritable(int size)

Overrides io.netty.buffer.AbstractByteBuf.isWritable.

Returns true if and only if this buffer has enough room to allow writing the specified number of elements.
public int
maxCapacity()

Overrides io.netty.buffer.AbstractByteBuf.maxCapacity.

Returns the maximum allowed capacity of this buffer.
public long
memoryAddress()

Implements abstract io.netty.buffer.ByteBuf.memoryAddress.

Returns the low-level memory address that point to the first byte of ths backing data.
public ByteBuffer
nioBuffer(int index, int length)

Implements abstract io.netty.buffer.ByteBuf.nioBuffer.

Exposes this buffer's sub-region as an NIO ByteBuffer.
public int
nioBufferCount()

Implements abstract io.netty.buffer.ByteBuf.nioBufferCount.

Returns the maximum number of NIO ByteBuffers that consist this buffer.
public ByteBuffer[]
nioBuffers(int index, int length)

Implements abstract io.netty.buffer.ByteBuf.nioBuffers.

Exposes this buffer's bytes as an NIO ByteBuffer's for the specified index and length The returned buffer either share or contains the copied content of this buffer, while changing the position and limit of the returned NIO buffer does not affect the indexes and marks of this buffer.
public ByteOrder
order()

Implements abstract io.netty.buffer.ByteBuf.order.

Returns the endianness of this buffer.
public ByteBuf
setByte(int index, int value)

Overrides io.netty.buffer.AbstractByteBuf.setByte.

Sets the specified byte at the specified absolute index in this buffer.
public ByteBuf
setBytes(int index, ByteBuf src, int
the first index of the source
srcIndex
,
int
the number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Transfers the specified source buffer's data to this buffer starting at the specified absolute index.
public ByteBuf
setBytes(int index, byte[] src, int srcIndex, int length)

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Transfers the specified source array's data to this buffer starting at the specified absolute index.
public ByteBuf
setBytes(int index, ByteBuffer src)

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Transfers the specified source buffer's data to this buffer starting at the specified absolute index until the source buffer's position reaches its limit.
public int
setBytes(int index, InputStream in, int
the number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Transfers the content of the specified source stream to this buffer starting at the specified absolute index.
public int
setBytes(int index, ScatteringByteChannel in, int
the maximum number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Transfers the content of the specified source channel to this buffer starting at the specified absolute index.
public int
setBytes(int index, FileChannel in, long
the file position at which the transfer is to begin
position
,
int
the maximum number of bytes to transfer
length
)

Implements abstract io.netty.buffer.ByteBuf.setBytes.

Transfers the content of the specified source channel starting at the given file position to this buffer starting at the specified absolute index.
public ByteBuf
setInt(int index, int value)

Overrides io.netty.buffer.AbstractByteBuf.setInt.

Sets the specified 32-bit integer at the specified absolute index in this buffer.
public ByteBuf
setLong(int index, long value)

Overrides io.netty.buffer.AbstractByteBuf.setLong.

Sets the specified 64-bit long integer at the specified absolute index in this buffer.
public ByteBuf
setMedium(int index, int value)

Overrides io.netty.buffer.AbstractByteBuf.setMedium.

Sets the specified 24-bit medium integer at the specified absolute index in this buffer.
public ByteBuf
setShort(int index, int value)

Overrides io.netty.buffer.AbstractByteBuf.setShort.

Sets the specified 16-bit short integer at the specified absolute index in this buffer.
public String
toString()

Overrides io.netty.buffer.AbstractByteBuf.toString.

Returns the string representation of this buffer.
public ByteBuf
unwrap()

Implements abstract io.netty.buffer.ByteBuf.unwrap.

Return the underlying buffer instance if this buffer is a wrapper of another buffer.
Inherited from io.netty.buffer.AbstractReferenceCountedByteBuf:
isAccessiblerefCntreleasereleaseresetRefCntretainretainsetRefCnttouchtouch