Class BinaryEncoder
- java.lang.Object
-
- org.infinispan.commons.dataconversion.BinaryEncoder
-
-
Constructor Summary
Constructors Constructor Description BinaryEncoder(StreamingMarshaller marshaller)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectfromStorage(Object stored)Convert from storage format to the read/write format.MediaTypegetStorageFormat()Returns theMediaTypeproduced by this encoder or null if the storage format is not known.shortid()Each encoder is associated with an unique id in order to optimize serialization.booleanisStorageFormatFilterable()protected byte[]marshall(Object source)ObjecttoStorage(Object content)Convert data in the read/write format to the storage format.protected Objectunmarshall(byte[] source)
-
-
-
Constructor Detail
-
BinaryEncoder
public BinaryEncoder(StreamingMarshaller marshaller)
-
-
Method Detail
-
toStorage
public Object toStorage(Object content)
Description copied from interface:EncoderConvert data in the read/write format to the storage format.
-
fromStorage
public Object fromStorage(Object stored)
Description copied from interface:EncoderConvert from storage format to the read/write format.- Specified by:
fromStoragein interfaceEncoder- Parameters:
stored- data as stored in the cache, never null.- Returns:
- data in the read/write format
-
isStorageFormatFilterable
public boolean isStorageFormatFilterable()
- Specified by:
isStorageFormatFilterablein interfaceEncoder- Returns:
- if true, will perform stream and related operation in the storage format.
-
getStorageFormat
public MediaType getStorageFormat()
Description copied from interface:EncoderReturns theMediaTypeproduced by this encoder or null if the storage format is not known.- Specified by:
getStorageFormatin interfaceEncoder
-
id
public short id()
Description copied from interface:EncoderEach encoder is associated with an unique id in order to optimize serialization. Known ids are kept inEncoderIds.
-
unmarshall
protected Object unmarshall(byte[] source) throws IOException, ClassNotFoundException
- Throws:
IOExceptionClassNotFoundException
-
marshall
protected byte[] marshall(Object source) throws IOException, InterruptedException
- Throws:
IOExceptionInterruptedException
-
-