public class BufferToArrayEncoder extends BufferToArrayCodec implements IEncoder<ByteBuffer,byte[]>
ByteBuffer
into an array of bytes.Constructor and Description |
---|
BufferToArrayEncoder()
Constructs an encoder with no buffer releasing.
|
BufferToArrayEncoder(boolean release)
Constructs an encoder with a specified buffer releasing mode.
|
Modifier and Type | Method and Description |
---|---|
void |
encode(ISession session,
ByteBuffer data,
List<byte[]> out)
Encodes data from one type to another one.
|
getInboundType, getOutboundType, toArray
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getInboundType, getOutboundType
public BufferToArrayEncoder(boolean release)
release
- the releasing mode determining if the input buffer should be
released by the session's allocatorpublic BufferToArrayEncoder()
public void encode(ISession session, ByteBuffer data, List<byte[]> 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–2022 SNF4J.ORG. All rights reserved.