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 aContextResolver<Kryo>registered.- Author:
- Libor Kramolis
-
-
Constructor Summary
Constructors Constructor Description KryoMessageBodyProvider(Providers providers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetSize(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)ObjectreadFrom(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)
-
-
-
Method Detail
-
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
-
-