public void serialize ( final Object obj , final OutputStream stream , final int bufferSize ) { ByteBufferOutput out = new ByteBufferOutput ( stream , bufferSize ) ; Kryo kryo = borrow ( ) ; try { kryo . writeClassAndObject ( out , obj ) ; out . flush ( ) ; } finally { release ( kryo ) ; } }
Serializes given object to OutputStream using Kryo instance in pool .