public void write (Kryo kryo, Output output, Object object) {
Deflater deflater = new Deflater(compressionLevel, noHeaders);
OutputChunked outputChunked = new OutputChunked(output, 256);
DeflaterOutputStream deflaterStream = new DeflaterOutputStream(outputChunked, deflater);
Output deflaterOutput = new Output(deflaterStream, 256);
kryo.writeObject(deflaterOutput, object, serializer);
deflaterOutput.flush();
try {
deflaterStream.finish();
} catch (IOException ex) {
throw new KryoException(ex);
}