use of com.esotericsoftware.kryo.pool.KryoCallback in project jersey by jersey.
the class KryoMessageBodyProvider method writeTo.
@Override
public void writeTo(final Object object, final Class<?> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType, final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws IOException, WebApplicationException {
final Output output = new Output(entityStream);
kryoPool.run(new KryoCallback() {
public Object execute(Kryo kryo) {
kryo.writeObject(output, object);
return null;
}
});
output.flush();
}
Aggregations