public class BigEndianHeapChannelBuffer extends HeapChannelBuffer
ChannelBuffers.buffer(int)
and ChannelBuffers.wrappedBuffer(byte[])
instead of calling the
constructor explicitly.array
Constructor and Description |
---|
BigEndianHeapChannelBuffer(byte[] array)
Creates a new big-endian heap buffer with an existing byte array.
|
BigEndianHeapChannelBuffer(int length)
Creates a new big-endian heap buffer with a newly allocated byte array.
|
Modifier and Type | Method and Description |
---|---|
ChannelBuffer |
copy(int index,
int length)
Returns a copy of this buffer's sub-region.
|
ChannelBuffer |
duplicate()
Returns a buffer which shares the whole region of this buffer.
|
ChannelBufferFactory |
factory()
Returns the factory which creates a
ChannelBuffer whose
type and default ByteOrder are same with this buffer. |
int |
getInt(int index)
Gets a 32-bit integer at the specified absolute
index in
this buffer. |
long |
getLong(int index)
Gets a 64-bit long integer at the specified absolute
index in
this buffer. |
short |
getShort(int index)
Gets a 16-bit short integer at the specified absolute
index in
this buffer. |
int |
getUnsignedMedium(int index)
Gets an unsigned 24-bit medium integer at the specified absolute
index in this buffer. |
ByteOrder |
order()
Returns the endianness
of this buffer.
|
void |
setInt(int index,
int value)
Sets the specified 32-bit integer at the specified absolute
index in this buffer. |
void |
setLong(int index,
long value)
Sets the specified 64-bit long integer at the specified absolute
index in this buffer. |
void |
setMedium(int index,
int value)
Sets the specified 24-bit medium integer at the specified absolute
index in this buffer. |
void |
setShort(int index,
int value)
Sets the specified 16-bit short integer at the specified absolute
index in this buffer. |
array, arrayOffset, capacity, getByte, getBytes, getBytes, getBytes, getBytes, getBytes, hasArray, isDirect, setByte, setBytes, setBytes, setBytes, setBytes, setBytes, slice, toByteBuffer
bytesBefore, bytesBefore, bytesBefore, bytesBefore, bytesBefore, bytesBefore, checkReadableBytes, clear, compareTo, copy, discardReadBytes, ensureWritableBytes, equals, getBytes, getBytes, getBytes, getChar, getDouble, getFloat, getMedium, getUnsignedByte, getUnsignedInt, getUnsignedShort, hashCode, indexOf, indexOf, markReaderIndex, markWriterIndex, readable, readableBytes, readByte, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readChar, readDouble, readerIndex, readerIndex, readFloat, readInt, readLong, readMedium, readShort, readSlice, readSlice, readUnsignedByte, readUnsignedInt, readUnsignedMedium, readUnsignedShort, resetReaderIndex, resetWriterIndex, setBytes, setBytes, setBytes, setChar, setDouble, setFloat, setIndex, setZero, skipBytes, skipBytes, slice, toByteBuffer, toByteBuffers, toByteBuffers, toString, toString, toString, toString, toString, toString, toString, writable, writableBytes, writeByte, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeChar, writeDouble, writeFloat, writeInt, writeLong, writeMedium, writerIndex, writerIndex, writeShort, writeZero
public BigEndianHeapChannelBuffer(int length)
length
- the length of the new byte arraypublic BigEndianHeapChannelBuffer(byte[] array)
array
- the byte array to wrappublic ChannelBufferFactory factory()
ChannelBuffer
ChannelBuffer
whose
type and default ByteOrder
are same with this buffer.public ByteOrder order()
ChannelBuffer
public short getShort(int index)
ChannelBuffer
index
in
this buffer. This method does not modify readerIndex
or
writerIndex
of this buffer.public int getUnsignedMedium(int index)
ChannelBuffer
index
in this buffer. This method does not modify
readerIndex
or writerIndex
of this buffer.public int getInt(int index)
ChannelBuffer
index
in
this buffer. This method does not modify readerIndex
or
writerIndex
of this buffer.public long getLong(int index)
ChannelBuffer
index
in
this buffer. This method does not modify readerIndex
or
writerIndex
of this buffer.public void setShort(int index, int value)
ChannelBuffer
index
in this buffer. The 16 high-order bits of the specified
value are ignored.
This method does not modify readerIndex
or writerIndex
of
this buffer.public void setMedium(int index, int value)
ChannelBuffer
index
in this buffer. Please note that the most significant
byte is ignored in the specified value.
This method does not modify readerIndex
or writerIndex
of
this buffer.public void setInt(int index, int value)
ChannelBuffer
index
in this buffer.
This method does not modify readerIndex
or writerIndex
of
this buffer.public void setLong(int index, long value)
ChannelBuffer
index
in this buffer.
This method does not modify readerIndex
or writerIndex
of
this buffer.public ChannelBuffer duplicate()
ChannelBuffer
buf.slice(0, buf.capacity())
.
This method does not modify readerIndex
or writerIndex
of
this buffer.public ChannelBuffer copy(int index, int length)
ChannelBuffer
readerIndex
or writerIndex
of
this buffer.Copyright © 2008-2014 The Netty Project. All Rights Reserved.