public class ArrayToBufferHolderEncoder extends ArrayToBufferHolderCodec implements IEncoder<byte[],IByteBufferHolder>
IByteBufferHolder
.Constructor and Description |
---|
ArrayToBufferHolderEncoder()
Constructs a encoder with no buffer allocation (only by wrapping the input array)
|
ArrayToBufferHolderEncoder(boolean allocate)
Constructs an encoder with a specified allocation mode.
|
Modifier and Type | Method and Description |
---|---|
void |
encode(ISession session,
byte[] data,
List<IByteBufferHolder> 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 ArrayToBufferHolderEncoder(boolean allocate)
allocate
- the allocation mode determining if the buffer in the output
buffer holder should be allocated by the session's allocator
or the buffer should wrap the input array.public ArrayToBufferHolderEncoder()
public void encode(ISession session, byte[] data, List<IByteBufferHolder> 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.
encode
in interface IEncoder<byte[],IByteBufferHolder>
session
- the ISession
which the passed data belongs todata
- the data to decode to another oneout
- the List
to which the decoded data should be added, or
null
if O is Void
Exception
- is thrown, if an error occurCopyright © 2017–2022 SNF4J.ORG. All rights reserved.