org.jboss.resteasy.core.messagebody

## Class WriterUtility

- java.lang.Object
- - org.jboss.resteasy.core.messagebody.WriterUtility

-     public abstract class WriterUtility
      extends Object

  Utility for accessing RESTEasy's MessageBodyWrite setup
  Version:
    $Revision: 1 $
  Author:
    Solomon Duskis

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `WriterUtility()`
    `WriterUtility(ResteasyProviderFactory factory, WriterInterceptor[] interceptors)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `asString(Object toOutput, String contentType)`
    `abstract RuntimeException` | `createWriterNotFound(Type genericType, MediaType mediaType)`
    `void` | `doWrite(HttpResponse response, Object toOutput, Class type, Type genericType, Annotation[] annotations, MediaType mediaType)`
    `void` | `doWrite(Object toOutput, Class type, MediaType mediaType, OutputStream os)`
    `void` | `doWrite(Object toOutput, Class type, Type genericType, MediaType mediaType, Annotation[] annotations, MultivaluedMap<String,Object> requestHeaders, OutputStream outputStream)`
    `void` | `doWrite(Object toOutput, Class type, Type genericType, MediaType mediaType, MultivaluedMap<String,Object> requestHeaders, OutputStream os)`
    `void` | `doWrite(Object toOutput, MediaType mediaType, OutputStream os)`
    `static byte[]` | `getBytes(Object toOutput, String contentType)`
    `static void` | `write(Object toOutput, MediaType mt, OutputStream os)`

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

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

- - ### Constructor Detail

    - #### WriterUtility

          public WriterUtility()

    - #### WriterUtility

          public WriterUtility(ResteasyProviderFactory factory,
                       WriterInterceptor[] interceptors)

  - ### Method Detail

    - #### asString

          public static String asString(Object toOutput,
                        String contentType)
                                 throws IOException

      Throws:
        `IOException`

    - #### getBytes

          public static byte[] getBytes(Object toOutput,
                        String contentType)
                                 throws IOException

      Throws:
        `IOException`

    - #### write

          public static void write(Object toOutput,
                   MediaType mt,
                   OutputStream os)
                            throws IOException

      Throws:
        `IOException`

    - #### doWrite

          public void doWrite(Object toOutput,
                     MediaType mediaType,
                     OutputStream os)
                       throws IOException

      Throws:
        `IOException`

    - #### doWrite

          public void doWrite(Object toOutput,
                     Class type,
                     MediaType mediaType,
                     OutputStream os)
                       throws IOException

      Throws:
        `IOException`

    - #### doWrite

          public void doWrite(Object toOutput,
                     Class type,
                     Type genericType,
                     MediaType mediaType,
                     MultivaluedMap<String,Object> requestHeaders,
                     OutputStream os)
                       throws IOException

      Throws:
        `IOException`

    - #### doWrite

          public void doWrite(HttpResponse response,
                     Object toOutput,
                     Class type,
                     Type genericType,
                     Annotation[] annotations,
                     MediaType mediaType)
                       throws IOException

      Throws:
        `IOException`

    - #### doWrite

          public void doWrite(Object toOutput,
                     Class type,
                     Type genericType,
                     MediaType mediaType,
                     Annotation[] annotations,
                     MultivaluedMap<String,Object> requestHeaders,
                     OutputStream outputStream)
                       throws IOException

      Throws:
        `IOException`

    - #### createWriterNotFound

          public abstract RuntimeException createWriterNotFound(Type genericType,
                                              MediaType mediaType)

Copyright © 2014. All Rights Reserved.