Class KryoMessageBodyProvider
java.lang.Object
org.glassfish.jersey.kryo.internal.KryoMessageBodyProvider
- All Implemented Interfaces:
MessageBodyReader<Object>,MessageBodyWriter<Object>
@Provider
@Consumes("application/x-kryo")
@Produces("application/x-kryo")
public class KryoMessageBodyProvider
extends Object
implements MessageBodyWriter<Object>, MessageBodyReader<Object>
The KryoMessageBodyProvider expects a
ContextResolver<Kryo> registered.- Author:
- Libor Kramolis
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetSize(Object object, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) booleanisReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) booleanisWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) voidwriteTo(Object object, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream)
-
Constructor Details
-
KryoMessageBodyProvider
-
-
Method Details
-
getSize
public long getSize(Object object, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) - Specified by:
getSizein interfaceMessageBodyWriter<Object>
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) - Specified by:
isWriteablein interfaceMessageBodyWriter<Object>
-
writeTo
public void writeTo(Object object, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException- Specified by:
writeToin interfaceMessageBodyWriter<Object>- Throws:
IOExceptionWebApplicationException
-
isReadable
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) - Specified by:
isReadablein interfaceMessageBodyReader<Object>
-
readFrom
public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, WebApplicationException- Specified by:
readFromin interfaceMessageBodyReader<Object>- Throws:
IOExceptionWebApplicationException
-