Class ByteArrayProvider

  • All Implemented Interfaces:
    javax.ws.rs.ext.MessageBodyReader<byte[]>, javax.ws.rs.ext.MessageBodyWriter<byte[]>

    @Deprecated
    @Provider
    public class ByteArrayProvider
    extends AbstractProvider<byte[]>
    Deprecated.
    Will be removed in next minor release.
    Provider to read and write byte[].
    • Constructor Summary

      Constructors 
      Constructor Description
      ByteArrayProvider()
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      long getSize​(byte[] t, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
      Deprecated.
      Returns the size of the given objects.
      byte[] readFrom​(java.lang.Class<byte[]> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> httpHeaders, java.io.InputStream entityStream)
      Deprecated.
       
      protected java.lang.Class<?> supportedClass()
      Deprecated.
      Returns the class object supported by this provider.
      void writeTo​(byte[] data, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.Object> httpHeaders, java.io.OutputStream entityStream)
      Deprecated.
       
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ByteArrayProvider

        public ByteArrayProvider()
        Deprecated.
    • Method Detail

      • getSize

        public long getSize​(byte[] t,
                            java.lang.Class<?> type,
                            java.lang.reflect.Type genericType,
                            java.lang.annotation.Annotation[] annotations,
                            javax.ws.rs.core.MediaType mediaType)
        Deprecated.
        Description copied from class: AbstractProvider
        Returns the size of the given objects.
        Specified by:
        getSize in interface javax.ws.rs.ext.MessageBodyWriter<byte[]>
        Specified by:
        getSize in class AbstractProvider<byte[]>
        Parameters:
        t - the object to check the size
        Returns:
        the size of the object, or -1, if it is not direct readable from the object.
        See Also:
        MessageBodyWriter.getSize(java.lang.Object, java.lang.Class, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType)
      • readFrom

        public byte[] readFrom​(java.lang.Class<byte[]> type,
                               java.lang.reflect.Type genericType,
                               java.lang.annotation.Annotation[] annotations,
                               javax.ws.rs.core.MediaType mediaType,
                               javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> httpHeaders,
                               java.io.InputStream entityStream)
                        throws java.io.IOException
        Deprecated.
        Specified by:
        readFrom in interface javax.ws.rs.ext.MessageBodyReader<byte[]>
        Specified by:
        readFrom in class AbstractProvider<byte[]>
        genericType - The generic Type to convert to.
        annotations - the annotations of the artefact to convert to
        Throws:
        java.io.IOException
        See Also:
        javax.ws.rs.ext.MessageBodyReader#readFrom(java.lang.Class, javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap, java.io.InputStream)
      • supportedClass

        protected java.lang.Class<?> supportedClass()
        Deprecated.
        Description copied from class: AbstractProvider
        Returns the class object supported by this provider.
        Overrides:
        supportedClass in class AbstractProvider<byte[]>
        Returns:
        the class object supported by this provider.
        See Also:
        MessageBodyWriter#isWriteable(Class)
      • writeTo

        public void writeTo​(byte[] data,
                            java.lang.Class<?> type,
                            java.lang.reflect.Type genericType,
                            java.lang.annotation.Annotation[] annotations,
                            javax.ws.rs.core.MediaType mediaType,
                            javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.Object> httpHeaders,
                            java.io.OutputStream entityStream)
                     throws java.io.IOException
        Deprecated.
        Specified by:
        writeTo in interface javax.ws.rs.ext.MessageBodyWriter<byte[]>
        Specified by:
        writeTo in class AbstractProvider<byte[]>
        Throws:
        java.io.IOException
        See Also:
        MessageBodyWriter.writeTo(Object, Class, Type, Annotation[], MediaType, MultivaluedMap, OutputStream)