public class BytableSerializer<RESULT extends Bytable> extends Object implements Serializer<RESULT>
BytableSerializer is used to write Bytable object to bytes and read bytes to Bytable object.
This is the default serializer in guagua.
| Constructor and Description |
|---|
BytableSerializer() |
| Modifier and Type | Method and Description |
|---|---|
RESULT |
bytesToObject(byte[] data,
String className)
De-serialize from bytes to object.
|
byte[] |
objectToBytes(RESULT result)
Serialize from object to bytes.
|
public byte[] objectToBytes(RESULT result)
objectToBytes in interface Serializer<RESULT extends Bytable>NullPointerException - if result is null.GuaguaRuntimeException - if any io exception.public RESULT bytesToObject(byte[] data, String className)
bytesToObject in interface Serializer<RESULT extends Bytable>NullPointerException - if className or data is null.GuaguaRuntimeException - if any io exception or other reflection exception.Copyright © 2019. All Rights Reserved.