public class CompositeCodec<P> extends java.lang.Object implements MultiTypeCodec<java.lang.Object>
Constructor and Description |
---|
CompositeCodec(java.util.Map<java.lang.Class<?>,AbstractCodec<P>> delegates,
MultiTypeCodec<P> defaultCodec) |
CompositeCodec(MultiTypeCodec<P> defaultCodec) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
deserialize(byte[] bytes,
java.lang.Class<?> type)
Deserialize an object of a given type
|
java.lang.Object |
deserialize(java.io.InputStream inputStream,
java.lang.Class<?> type)
Deserialize an object of a given type
|
void |
serialize(java.lang.Object object,
java.io.OutputStream outputStream) |
public CompositeCodec(java.util.Map<java.lang.Class<?>,AbstractCodec<P>> delegates, MultiTypeCodec<P> defaultCodec)
public CompositeCodec(MultiTypeCodec<P> defaultCodec)
public void serialize(java.lang.Object object, java.io.OutputStream outputStream) throws java.io.IOException
serialize
in interface org.springframework.core.serializer.Serializer<java.lang.Object>
java.io.IOException
public java.lang.Object deserialize(java.io.InputStream inputStream, java.lang.Class<?> type) throws java.io.IOException
MultiTypeCodec
deserialize
in interface MultiTypeCodec<java.lang.Object>
inputStream
- the input stream containing the serialized objecttype
- the object's classjava.io.IOException
public java.lang.Object deserialize(byte[] bytes, java.lang.Class<?> type) throws java.io.IOException
MultiTypeCodec
deserialize
in interface MultiTypeCodec<java.lang.Object>
bytes
- the byte array containing the serialized objecttype
- the object's classjava.io.IOException