code: public void serialize(final Object obj, final ByteBuffer buffer) {
      ByteBufferOutput out = new ByteBufferOutput(buffer);
      Kryo kryo = borrow();
      try {
        kryo.writeClassAndObject(out, obj);
        out.flush();
      } finally {
        release(kryo);
      }
    }
docs: Serializes given object to byte buffer using Kryo instance in pool.
  
  @param obj    Object to serialize
  @param buffer to write to