public static final class ByteArrayUtil.StringSerializer extends java.lang.Object implements ByteBufferSerializer<java.lang.String>
Modifier and Type | Field and Description |
---|---|
(package private) java.nio.charset.Charset |
charset
Character set to use.
|
(package private) java.nio.charset.CharsetDecoder |
decoder
Decoder.
|
(package private) java.nio.charset.CharsetEncoder |
encoder
Encoder.
|
Modifier | Constructor and Description |
---|---|
private |
StringSerializer()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
fromByteBuffer(java.nio.ByteBuffer buffer)
Deserialize an object from a byte buffer (e.g. disk)
|
int |
getByteSize(java.lang.String object)
Get the size of the object in bytes.
|
void |
toByteBuffer(java.nio.ByteBuffer buffer,
java.lang.String obj)
Serialize the object to a byte array (e.g. disk)
|
java.nio.charset.Charset charset
java.nio.charset.CharsetEncoder encoder
java.nio.charset.CharsetDecoder decoder
private StringSerializer()
public java.lang.String fromByteBuffer(java.nio.ByteBuffer buffer) throws java.io.IOException
ByteBufferSerializer
fromByteBuffer
in interface ByteBufferSerializer<java.lang.String>
buffer
- Data array to processjava.io.IOException
- on IO errorspublic void toByteBuffer(java.nio.ByteBuffer buffer, java.lang.String obj) throws java.io.IOException
ByteBufferSerializer
toByteBuffer
in interface ByteBufferSerializer<java.lang.String>
buffer
- Buffer to serialize toobj
- Object to serializejava.io.IOException
- on IO errorspublic int getByteSize(java.lang.String object) throws java.io.IOException
ByteBufferSerializer
getByteSize
in interface ByteBufferSerializer<java.lang.String>
object
- Object to serializejava.io.IOException
- on IO errorsCopyright © 2019 ELKI Development Team. License information.