public < T > T deserialize ( final InputStream stream , final int bufferSize ) { ByteBufferInput in = new ByteBufferInput ( stream , bufferSize ) ; Kryo kryo = borrow ( ) ; try { @ SuppressWarnings ( "unchecked" ) T obj = ( T ) kryo . readClassAndObject ( in ) ; return obj ; } finally { release ( kryo ) ; } }
Deserializes given InputStream to an Object using Kryo instance in pool .