public class ArrayToBufferEncoder extends ArrayToBufferCodec implements IEncoder<byte[],ByteBuffer>
ByteBuffer
.Constructor and Description |
---|
ArrayToBufferEncoder()
Constructs an encoder with no buffer allocation (only by wrapping the input array)
|
ArrayToBufferEncoder(boolean allocate)
Constructs an encoder with a specified allocation mode.
|
Modifier and Type | Method and Description |
---|---|
void |
encode(ISession session,
byte[] data,
List<ByteBuffer> out)
Encodes data from one type to another one.
|
getInboundType, getOutboundType
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getInboundType, getOutboundType
public ArrayToBufferEncoder(boolean allocate)
allocate
- the allocation mode determining if the output buffer should
be allocated by the session's allocator or the buffer should
wrap the input array.public ArrayToBufferEncoder()
public void encode(ISession session, byte[] data, List<ByteBuffer> out) throws Exception
IEncoder
Encoders that do not produce an output (i.e. the O parameter is
Void
) cannot change the object passed as the data
argument. They should not also store it for future use as its state can
be changed.
The above limitations regarding the data
argument do not apply to
encoders that produce an output.
Copyright © 2017–2021 SNF4J.ORG. All rights reserved.