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
-
Method Summary
Modifier and TypeMethodDescriptionlong
getSize
(Object object, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) boolean
isReadable
(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) boolean
isWriteable
(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) readFrom
(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) void
writeTo
(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:
getSize
in interfaceMessageBodyWriter<Object>
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) - Specified by:
isWriteable
in 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:
writeTo
in interfaceMessageBodyWriter<Object>
- Throws:
IOException
WebApplicationException
-
isReadable
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) - Specified by:
isReadable
in 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:
readFrom
in interfaceMessageBodyReader<Object>
- Throws:
IOException
WebApplicationException
-