Package org.ehcache.impl.serialization
Class ByteArraySerializer
java.lang.Object
org.ehcache.impl.serialization.ByteArraySerializer
- All Implemented Interfaces:
org.ehcache.spi.serialization.Serializer<byte[]>
public class ByteArraySerializer
extends Object
implements org.ehcache.spi.serialization.Serializer<byte[]>
Default
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 Summary
ConstructorsConstructorDescriptionNo arg constructorByteArraySerializer(ClassLoader classLoader) Constructor to enable this serializer as a transient one. -
Method Summary
Modifier and TypeMethodDescriptionbooleanequals(byte[] object, ByteBuffer binary) byte[]read(ByteBuffer binary) serialize(byte[] object)
-
Constructor Details
-
ByteArraySerializer
public ByteArraySerializer()No arg constructor -
ByteArraySerializer
Constructor to enable this serializer as a transient one.Parameter is ignored as
byte[]is a base java type.- Parameters:
classLoader- the classloader to use- See Also:
-
Serializer
-
-
Method Details
-
serialize
- Specified by:
serializein interfaceorg.ehcache.spi.serialization.Serializer<byte[]>- Throws:
org.ehcache.spi.serialization.SerializerException
-
read
- Specified by:
readin interfaceorg.ehcache.spi.serialization.Serializer<byte[]>
-
equals
- Specified by:
equalsin interfaceorg.ehcache.spi.serialization.Serializer<byte[]>
-