public class ByteArraySerializer
extends java.lang.Object
implements org.ehcache.spi.serialization.Serializer<byte[]>
Serializer for byte[] type. Simply writes the byte array
to a byte buffer.
Note that equals(byte[], ByteBuffer) does not follow the byte[].equals(Object) contract but does
byte-to-byte comparison of both byte arrays.
| Constructor and Description |
|---|
ByteArraySerializer()
No arg constructor
|
ByteArraySerializer(java.lang.ClassLoader classLoader)
Constructor to enable this serializer as a transient one.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(byte[] object,
java.nio.ByteBuffer binary) |
byte[] |
read(java.nio.ByteBuffer binary) |
java.nio.ByteBuffer |
serialize(byte[] object) |
public ByteArraySerializer()
public ByteArraySerializer(java.lang.ClassLoader classLoader)
Parameter is ignored as byte[] is a base java type.
classLoader - the classloader to useSerializerpublic java.nio.ByteBuffer serialize(byte[] object)
throws org.ehcache.spi.serialization.SerializerException
serialize in interface org.ehcache.spi.serialization.Serializer<byte[]>org.ehcache.spi.serialization.SerializerExceptionpublic byte[] read(java.nio.ByteBuffer binary)
read in interface org.ehcache.spi.serialization.Serializer<byte[]>public boolean equals(byte[] object,
java.nio.ByteBuffer binary)
equals in interface org.ehcache.spi.serialization.Serializer<byte[]>