Class ByteArrayProvider
java.lang.Object
org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider<byte[]>
org.glassfish.jersey.message.internal.ByteArrayProvider
- All Implemented Interfaces:
MessageBodyReader<byte[]>
,MessageBodyWriter<byte[]>
@Produces({"application/octet-stream","*/*"})
@Consumes({"application/octet-stream","*/*"})
public final class ByteArrayProvider
extends AbstractMessageReaderWriterProvider<byte[]>
Default Jersey byte array entity provider (reader and writer).
- Author:
- Paul Sandoz, Marek Potociar
-
Field Summary
Fields inherited from class org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider
UTF8
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
getSize
(byte[] t, 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) byte[]
readFrom
(Class<byte[]> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) void
writeTo
(byte[] t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) Methods inherited from class org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider
getCharset, readFromAsString, writeTo, writeTo, writeToAsString
-
Constructor Details
-
ByteArrayProvider
public ByteArrayProvider()
-
-
Method Details
-
isReadable
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) -
readFrom
public byte[] readFrom(Class<byte[]> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException- Throws:
IOException
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) -
writeTo
public void writeTo(byte[] t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException- Throws:
IOException
-
getSize
public long getSize(byte[] t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) - Specified by:
getSize
in interfaceMessageBodyWriter<byte[]>
- Overrides:
getSize
in classAbstractMessageReaderWriterProvider<byte[]>
-