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> TfromByteArray(byte[] bytes, Class<T> type) Produces an object of typeTfrom an array of bytes.default ObjectfromByteArray(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 typeTfrom an array of bytes.- Throws:
IOException- if serialization to byte array fails
-
fromByteArray
- Throws:
IOException
-