ml.shifu.guagua.io
类 BytableSerializer<RESULT extends Bytable>
java.lang.Object
ml.shifu.guagua.io.BytableSerializer<RESULT>
- 所有已实现的接口:
- Serializer<RESULT>
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.
| 从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BytableSerializer
public BytableSerializer()
objectToBytes
public byte[] objectToBytes(RESULT result)
- Serialize from object to bytes.
- 指定者:
- 接口
Serializer<RESULT extends Bytable> 中的 objectToBytes
- 抛出:
NullPointerException - if result is null.
GuaguaRuntimeException - if any io exception.
bytesToObject
public RESULT bytesToObject(byte[] data,
String className)
- De-serialize from bytes to object. One should provide the class name before de-serializing the object.
- 指定者:
- 接口
Serializer<RESULT extends Bytable> 中的 bytesToObject
- 抛出:
NullPointerException - if className or data is null.
GuaguaRuntimeException - if any io exception or other reflection exception.
Copyright © 2014. All Rights Reserved.