}
private byte[] toBytes(RevObject object) {
ObjectWriter<RevObject> writer = serializers.createObjectWriter(object.getType());
ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
LZFOutputStream cOut = new LZFOutputStream(byteStream);
try {
writer.write(object, cOut);
} catch (IOException e) {
throw new RuntimeException(e);
}
try {
cOut.close();
} catch (IOException e) {
throw Throwables.propagate(e);
}
return byteStream.toByteArray();
}