public final class SerializerString extends Object implements Serializer<String>
Constructor and Description |
---|
SerializerString(Charset charset) |
Modifier and Type | Method and Description |
---|---|
String |
deserialize(byte[] bytes)
Returns a non-null instance of T from the byte array of length > 0.
|
byte[] |
serialize(String s)
Returns a byte array of length > 0 that is the serialization of the
given value.
|
public SerializerString(Charset charset)
public byte[] serialize(String s) throws IOException
Serializer
serialize
in interface Serializer<String>
s
- value to be serialized into a byte array, should not be null.IOException
- on errorpublic String deserialize(byte[] bytes) throws IOException, ClassNotFoundException
Serializer
deserialize
in interface Serializer<String>
bytes
- byte array, should have length > 0IOException
- on errorClassNotFoundException
- if class T not foundCopyright © 2013–2020. All rights reserved.