public static final class ByteArrayUtil.StringSerializer extends Object implements ByteBufferSerializer<String>
Modifier and Type | Field and Description |
---|---|
(package private) Charset |
charset
Character set to use.
|
(package private) CharsetDecoder |
decoder
Decoder.
|
(package private) CharsetEncoder |
encoder
Encoder.
|
Modifier | Constructor and Description |
---|---|
private |
ByteArrayUtil.StringSerializer()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
fromByteBuffer(ByteBuffer buffer)
Deserialize an object from a byte buffer (e.g. disk)
|
int |
getByteSize(String object)
Get the size of the object in bytes.
|
void |
toByteBuffer(ByteBuffer buffer,
String obj)
Serialize the object to a byte array (e.g. disk)
|
Charset charset
CharsetEncoder encoder
CharsetDecoder decoder
private ByteArrayUtil.StringSerializer()
public String fromByteBuffer(ByteBuffer buffer)
ByteBufferSerializer
fromByteBuffer
in interface ByteBufferSerializer<String>
buffer
- Data array to processpublic void toByteBuffer(ByteBuffer buffer, String obj)
ByteBufferSerializer
toByteBuffer
in interface ByteBufferSerializer<String>
buffer
- Buffer to serialize toobj
- Object to serializepublic int getByteSize(String object)
ByteBufferSerializer
getByteSize
in interface ByteBufferSerializer<String>
object
- Object to serialize