public class ByteArraySerializer extends AbstractElementSerializer<byte[]>
| Modifier and Type | Field and Description |
|---|---|
static ByteArraySerializer |
INSTANCE
A static instance of a BytearraySerializer
|
| Constructor and Description |
|---|
ByteArraySerializer(Comparator<byte[]> comparator)
Create a new instance of ByteArraySerializer with custom comparator
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
deserialize(BufferHandler bufferHandler)
Deserialize an element from a BufferHandler
|
static byte[] |
deserialize(byte[] in)
A static method used to deserialize a byte array from a byte array.
|
static byte[] |
deserialize(byte[] in,
int start)
A static method used to deserialize a byte array from a byte array.
|
byte[] |
deserialize(ByteBuffer buffer)
Deserialize an element from a ByteBuffer
|
byte[] |
fromBytes(byte[] in)
A method used to deserialize a byte array from a byte array.
|
byte[] |
fromBytes(byte[] in,
int start)
A method used to deserialize a byte array from a byte array.
|
byte[] |
serialize(byte[] element)
Produce the byte[] representation of the element
|
static byte[] |
serialize(byte[] buffer,
int start,
byte[] element)
Serialize a byte[]
|
compare, getComparator, getTypepublic static final ByteArraySerializer INSTANCE
public ByteArraySerializer(Comparator<byte[]> comparator)
public byte[] serialize(byte[] element)
element - The element to serializepublic static byte[] serialize(byte[] buffer,
int start,
byte[] element)
buffer - the Buffer that will contain the serialized valuestart - the position in the buffer we will store the serialized byte[]value - the value to serializepublic static byte[] deserialize(byte[] in)
in - The byte array containing the byte arraypublic static byte[] deserialize(byte[] in,
int start)
in - The byte array containing the byte arraystart - the position in the byte[] we will deserialize the byte[] frompublic byte[] fromBytes(byte[] in)
in - The byte array containing the byte arraypublic byte[] fromBytes(byte[] in,
int start)
in - The byte array containing the byte arraystart - the position in the byte[] we will deserialize the byte[] frompublic byte[] deserialize(BufferHandler bufferHandler) throws IOException
bufferHandler - The incoming bufferHandlerIOException - If the deserialization failedpublic byte[] deserialize(ByteBuffer buffer) throws IOException
buffer - The incoming ByteBufferIOException - If the deserialization failedCopyright © 2012–2015 Apache Mavibot Project Parent. All rights reserved.