|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ChannelBufferFactory
A factory that creates or pools ChannelBuffers.
| Method Summary | |
|---|---|
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(java.nio.ByteBuffer nioBuffer)
Returns a ChannelBuffer whose content is equal to the sub-region
of the specified nioBuffer. |
ChannelBuffer |
getBuffer(java.nio.ByteOrder endianness,
byte[] array,
int offset,
int length)
Returns a ChannelBuffer whose content is equal to the sub-region
of the specified array. |
ChannelBuffer |
getBuffer(java.nio.ByteOrder endianness,
int capacity)
Returns a ChannelBuffer with the specified endianness
and capacity. |
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 getBuffer(int). |
| Method Detail |
|---|
ChannelBuffer getBuffer(int capacity)
ChannelBuffer with the specified capacity.
This method is identical to getBuffer(getDefaultOrder(), capacity).
capacity - the capacity of the returned ChannelBuffer
ChannelBuffer with the specified capacity,
whose readerIndex and writerIndex are 0
ChannelBuffer getBuffer(java.nio.ByteOrder endianness,
int capacity)
ChannelBuffer with the specified endianness
and capacity.
endianness - the endianness of the returned ChannelBuffercapacity - the capacity of the returned ChannelBuffer
ChannelBuffer with the specified endianness and
capacity, whose readerIndex and writerIndex
are 0
ChannelBuffer getBuffer(byte[] array,
int offset,
int length)
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).
array - the byte arrayoffset - the offset of the byte arraylength - the length of the byte array
ChannelBuffer with the specified content,
whose readerIndex and writerIndex
are 0 and (length - offset) respectively
ChannelBuffer getBuffer(java.nio.ByteOrder endianness,
byte[] array,
int offset,
int length)
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.
endianness - the endianness of the returned ChannelBufferarray - the byte arrayoffset - the offset of the byte arraylength - the length of the byte array
ChannelBuffer with the specified content,
whose readerIndex and writerIndex
are 0 and (length - offset) respectivelyChannelBuffer getBuffer(java.nio.ByteBuffer nioBuffer)
ChannelBuffer whose content is equal to the sub-region
of the specified nioBuffer. Depending on the factory
implementation, the returned buffer could wrap the nioBuffer or
create a new copy of the nioBuffer.
nioBuffer - the NIO ByteBuffer
ChannelBuffer with the specified content,
whose readerIndex and writerIndex
are 0 and nioBuffer.remaining() respectivelyjava.nio.ByteOrder getDefaultOrder()
ChannelBuffer which is
returned by getBuffer(int).
ChannelBuffer which is
returned by getBuffer(int)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||