Class JacksonJsonSerializer
java.lang.Object
org.drasyl.node.handler.serialization.JacksonJsonSerializer
- All Implemented Interfaces:
Serializer
A serializer based on the Jackson Library for
converting java objects to and from JSON.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> T
fromByteArray
(byte[] bytes, Class<T> type) Produces an object of typeT
from an array of bytes.byte[]
Serializes the given object into an array of bytesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.drasyl.node.handler.serialization.Serializer
fromByteArray
-
Constructor Details
-
JacksonJsonSerializer
public JacksonJsonSerializer()
-
-
Method Details
-
toByteArray
Description copied from interface:Serializer
Serializes the given object into an array of bytes- Specified by:
toByteArray
in interfaceSerializer
- Throws:
IOException
- if deserialization to byte array fails
-
fromByteArray
Description copied from interface:Serializer
Produces an object of typeT
from an array of bytes.- Specified by:
fromByteArray
in interfaceSerializer
- Throws:
IOException
- if serialization to byte array fails
-