org.jboss.resteasy.plugins.providers

## Class IIOImageProvider

- java.lang.Object
- - org.jboss.resteasy.plugins.providers.AbstractEntityProvider<IIOImage>
  - - org.jboss.resteasy.plugins.providers.IIOImageProvider

- All Implemented Interfaces:
    MessageBodyReader<IIOImage>, MessageBodyWriter<IIOImage>

      @Provider
      @Consumes(value="image/*")
      @Produces(value="image/*")
      public class IIOImageProvider
      extends AbstractEntityProvider<IIOImage>

  Version:
    $Revision:$
  Author:
    Ryan J. McDonough

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `IIOImageProvider()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)` Ascertain if the MessageBodyReader can produce an instance of a particular type.
    `boolean` | `isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)` Ascertain if the MessageBodyWriter supports a particular type.
    `IIOImage` | `readFrom(Class<IIOImage> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String,String> httpHeaders, InputStream entityStream)` Read a type from the `InputStream`.
    `void` | `writeTo(IIOImage t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream)` Write a type to an HTTP message.

    - ### Methods inherited from class org.jboss.resteasy.plugins.providers.AbstractEntityProvider

      `getSize`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### IIOImageProvider

          public IIOImageProvider()

  - ### Method Detail

    - #### isReadable

          public boolean isReadable(Class<?> type,
                           Type genericType,
                           Annotation[] annotations,
                           MediaType mediaType)

      Description copied from interface: `MessageBodyReader`
      Ascertain if the MessageBodyReader can produce an instance of a particular type. The `type` parameter gives the class of the instance that should be produced, the `genericType` parameter gives the `java.lang.reflect.Type` of the instance that should be produced. E.g. if the instance to be produced is `List<String>`, the `type` parameter will be `java.util.List` and the `genericType` parameter will be `java.lang.reflect.ParameterizedType`.
      Parameters:
        `type` -
        `genericType` -
        `annotations` -
        `mediaType` - the media type of the HTTP entity, if one is not specified in the request then `application/octet-stream` is used.
      Returns:
      See Also:
        `javax.ws.rs.ext.MessageBodyReader#isReadable(java.lang.Class, java.lang.reflect.Type, java.lang.annotation.Annotation[])`

    - #### readFrom

          public IIOImage readFrom(Class<IIOImage> type,
                          Type genericType,
                          Annotation[] annotations,
                          MediaType mediaType,
                          MultivaluedMap<String,String> httpHeaders,
                          InputStream entityStream)
                            throws IOException

      Description copied from interface: `MessageBodyReader`
      Read a type from the `InputStream`.

      In case the entity input stream is empty, the reader is expected to either return a Java representation of a zero-length entity or throw a `NoContentException` in case no zero-length entity representation is defined for the supported Java type. A `NoContentException`, if thrown by a message body reader while reading a server request entity, is automatically translated by JAX-RS server runtime into a `BadRequestException` wrapping the original `NoContentException` and rethrown for a standard processing by the registered `exception mappers`.

      Parameters:
        `type` -
        `genericType` -
        `annotations` -
        `mediaType` -
        `httpHeaders` -
        `entityStream` -
      Returns:
      Throws:
        `IOException`
        `WebApplicationException`
      See Also:
        `MessageBodyReader.readFrom(java.lang.Class, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap, java.io.InputStream)`

    - #### isWriteable

          public boolean isWriteable(Class<?> type,
                            Type genericType,
                            Annotation[] annotations,
                            MediaType mediaType)

      Description copied from interface: `MessageBodyWriter`
      Ascertain if the MessageBodyWriter supports a particular type.
      Parameters:
        `type` -
        `genericType` -
        `annotations` -
        `mediaType` - the media type of the HTTP entity.
      Returns:
      See Also:
        `javax.ws.rs.ext.MessageBodyWriter#isWriteable(java.lang.Class, java.lang.reflect.Type, java.lang.annotation.Annotation[])`

    - #### writeTo

          public void writeTo(IIOImage t,
                     Class<?> type,
                     Type genericType,
                     Annotation[] annotations,
                     MediaType mediaType,
                     MultivaluedMap<String,Object> httpHeaders,
                     OutputStream entityStream)
                       throws IOException

      Description copied from interface: `MessageBodyWriter`
      Write a type to an HTTP message. The message header map is mutable but any changes must be made before writing to the output stream since the headers will be flushed prior to writing the message body.
      Parameters:
        `t` -
        `type` -
        `genericType` -
        `annotations` -
        `mediaType` -
        `httpHeaders` -
        `entityStream` -
      Throws:
        `IOException`
        `WebApplicationException`
      See Also:
        `MessageBodyWriter.writeTo(java.lang.Object, java.lang.Class, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap, java.io.OutputStream)`

Copyright © 2014. All Rights Reserved.