Java源码示例:com.esotericsoftware.kryo.io.UnsafeOutput
示例1@Override
public byte[] objectToBytes(Object value) {
Output output = new UnsafeOutput(2000, -1);
output.writeByte(MARKER_KRYO);
kryo.get().writeClassAndObject(output, value);
return output.toBytes();
}
@Override
public byte[] objectToBytes(Object object) {
if (object == null) {
return EMPTY;
}
Output output = new UnsafeOutput(2000, -1);
kryo.get().writeClassAndObject(output, object);
return output.toBytes();
}