public class HeapChannelBufferFactory extends AbstractChannelBufferFactory
ChannelBufferFactory
which merely allocates a heap buffer with
the specified capacity. HeapChannelBufferFactory
should perform
very well in most situations because it relies on the JVM garbage collector,
which is highly optimized for heap allocation.Constructor and Description |
---|
HeapChannelBufferFactory()
Creates a new factory whose default
ByteOrder is
ByteOrder.BIG_ENDIAN . |
HeapChannelBufferFactory(ByteOrder defaultOrder)
Creates a new factory with the specified default
ByteOrder . |
Modifier and Type | Method and Description |
---|---|
ChannelBuffer |
getBuffer(ByteOrder order,
int capacity)
|
static ChannelBufferFactory |
getInstance() |
static ChannelBufferFactory |
getInstance(ByteOrder endianness) |
getBuffer, getDefaultOrder
public HeapChannelBufferFactory()
ByteOrder
is
ByteOrder.BIG_ENDIAN
.public static ChannelBufferFactory getInstance()
public static ChannelBufferFactory getInstance(ByteOrder endianness)
public ChannelBuffer getBuffer(ByteOrder order, int capacity)
ChannelBufferFactory
order
- the endianness of the returned ChannelBuffer
capacity
- the capacity of the returned ChannelBuffer
ChannelBuffer
with the specified endianness
and
capacity
, whose readerIndex
and writerIndex
are 0
Copyright © 2008-2012 JBoss, by Red Hat. All Rights Reserved.