public class ByteArraySerializer extends AbstractElementSerializer<byte[]>
| Modifier and Type | Field and Description |
|---|---|
static ByteArraySerializer |
INSTANCE
A static instance of a BytearraySerializer
|
| Modifier | Constructor and Description |
|---|---|
private |
ByteArraySerializer()
Create a new instance of ByteArraySerializer
|
|
ByteArraySerializer(java.util.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(java.nio.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
private ByteArraySerializer()
public ByteArraySerializer(java.util.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 java.io.IOException
bufferHandler - The incoming bufferHandlerjava.io.IOException - If the deserialization failedpublic byte[] deserialize(java.nio.ByteBuffer buffer)
throws java.io.IOException
buffer - The incoming ByteBufferjava.io.IOException - If the deserialization failed