Class StringSerializer
java.lang.Object
org.drasyl.node.handler.serialization.StringSerializer
- All Implemented Interfaces:
Serializer
This Serializer (de)serializes
String
objects.-
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
-
StringSerializer
public StringSerializer()
-
-
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
-