Interface Serializer
- All Known Implementing Classes:
BooleanSerializer
,ByteArraySerializer
,ByteSerializer
,CharacterSerializer
,DisabledSerializer
,DoubleSerializer
,FloatSerializer
,IntegerSerializer
,JacksonJsonSerializer
,JavaSerializer
,LongSerializer
,NullSerializer
,ProtobufSerializer
,ShortSerializer
,StringSerializer
public interface Serializer
A Serializer represents a bimap between an object and an array of bytes representing that
object.
Make sure that your implementation implements the standard constructor!
-
Method Summary
Modifier and TypeMethodDescription<T> T
fromByteArray
(byte[] bytes, Class<T> type) Produces an object of typeT
from an array of bytes.default Object
fromByteArray
(byte[] bytes, String typeName) byte[]
Serializes the given object into an array of bytes
-
Method Details
-
toByteArray
Serializes the given object into an array of bytes- Throws:
IOException
- if deserialization to byte array fails
-
fromByteArray
Produces an object of typeT
from an array of bytes.- Throws:
IOException
- if serialization to byte array fails
-
fromByteArray
- Throws:
IOException
-