public abstract class AbstractChannelBufferFactory extends java.lang.Object implements ChannelBufferFactory
ChannelBufferFactory
.限定符 | 构造器和说明 |
---|---|
protected |
AbstractChannelBufferFactory()
Creates a new factory whose default
ByteOrder is
ByteOrder.BIG_ENDIAN . |
protected |
AbstractChannelBufferFactory(java.nio.ByteOrder defaultOrder)
Creates a new factory with the specified default
ByteOrder . |
限定符和类型 | 方法和说明 |
---|---|
ChannelBuffer |
getBuffer(byte[] array,
int offset,
int length)
Returns a
ChannelBuffer whose content is equal to the sub-region
of the specified array . |
ChannelBuffer |
getBuffer(int capacity)
Returns a
ChannelBuffer with the specified capacity . |
java.nio.ByteOrder |
getDefaultOrder()
Returns the default endianness of the
ChannelBuffer which is
returned by ChannelBufferFactory.getBuffer(int) . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBuffer, getBuffer, getBuffer
protected AbstractChannelBufferFactory()
ByteOrder
is
ByteOrder.BIG_ENDIAN
.protected AbstractChannelBufferFactory(java.nio.ByteOrder defaultOrder)
ByteOrder
.defaultOrder
- the default ByteOrder
of this factorypublic ChannelBuffer getBuffer(int capacity)
ChannelBufferFactory
ChannelBuffer
with the specified capacity
.
This method is identical to getBuffer(getDefaultOrder(), capacity)
.getBuffer
在接口中 ChannelBufferFactory
capacity
- the capacity of the returned ChannelBuffer
ChannelBuffer
with the specified capacity
,
whose readerIndex
and writerIndex
are 0
public ChannelBuffer getBuffer(byte[] array, int offset, int length)
ChannelBufferFactory
ChannelBuffer
whose content is equal to the sub-region
of the specified array
. Depending on the factory implementation,
the returned buffer could wrap the array
or create a new copy of
the array
.
This method is identical to getBuffer(getDefaultOrder(), array, offset, length)
.getBuffer
在接口中 ChannelBufferFactory
array
- the byte arrayoffset
- the offset of the byte arraylength
- the length of the byte arrayChannelBuffer
with the specified content,
whose readerIndex
and writerIndex
are 0
and (length - offset)
respectivelypublic java.nio.ByteOrder getDefaultOrder()
ChannelBufferFactory
ChannelBuffer
which is
returned by ChannelBufferFactory.getBuffer(int)
.getDefaultOrder
在接口中 ChannelBufferFactory
ChannelBuffer
which is
returned by ChannelBufferFactory.getBuffer(int)