Package org.jboss.resteasy.plugins.providers

## Class ProviderHelper

- java.lang.Object
- - org.jboss.resteasy.plugins.providers.ProviderHelper

-     public final class ProviderHelper
      extends Object

  A utility class to provide supporting functionality to various entity providers.
  Version:
    $Revision: $
  Author:
    Ryan J. McDonough

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static int` | `asyncRead​(InputStream in, byte[] buf)` |
    `static int` | `asyncRead​(InputStream in, byte[] buf, int offset, int length)` |
    `static CompletionStage<Void>` | `completedException​(Throwable t)` |
    `static List<javax.ws.rs.core.MediaType>` | `getAvailableMediaTypes​(String[] mediaTypes)` |
    `static List<javax.ws.rs.core.Variant>` | `getAvailableVariants​(String[] mediaTypes)` |
    `static List<javax.ws.rs.core.Variant>` | `getAvailableVariants​(List<javax.ws.rs.core.MediaType> mediaTypes)` |
    `static String` | `readString​(InputStream in)` |
    `static String` | `readString​(InputStream in, javax.ws.rs.core.MediaType mediaType)` |
    `static void` | `writeTo​(InputStream in, OutputStream out)` |
    `static CompletionStage<Void>` | `writeTo​(InputStream in, AsyncOutputStream out)` |
    `static CompletionStage<Void>` | `writeToAndCloseInput​(InputStream in, AsyncOutputStream out)` |

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

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

- - ### Method Detail

    - #### readString

          public static String readString​(InputStream in)
                                   throws IOException

      Parameters:
        `in` - input stream
      Returns:
        string data
      Throws:
        `IOException` - if I/O error occurred

    - #### readString

          public static String readString​(InputStream in,
                                          javax.ws.rs.core.MediaType mediaType)
                                   throws IOException

      Parameters:
        `in` - input stream
        `mediaType` - media type
      Returns:
        string data
      Throws:
        `IOException` - if I/O error occurred

    - #### getAvailableMediaTypes

          public static List<javax.ws.rs.core.MediaType> getAvailableMediaTypes​(String[] mediaTypes)

      Parameters:
        `mediaTypes` - string array of media types
      Returns:
        list of media types

    - #### getAvailableVariants

          public static List<javax.ws.rs.core.Variant> getAvailableVariants​(String[] mediaTypes)

      Parameters:
        `mediaTypes` - string array of media types
      Returns:
        list of `Variant`

    - #### getAvailableVariants

          public static List<javax.ws.rs.core.Variant> getAvailableVariants​(List<javax.ws.rs.core.MediaType> mediaTypes)

      Parameters:
        `mediaTypes` - list of media types
      Returns:
        list of `Variant`

    - #### writeTo

          public static void writeTo​(InputStream in,
                                     OutputStream out)
                              throws IOException

      Parameters:
        `in` - input stream
        `out` - output stream
      Throws:
        `IOException` - if I/O error occurred

    - #### writeToAndCloseInput

          public static CompletionStage<Void> writeToAndCloseInput​(InputStream in,
                                                                   AsyncOutputStream out)

      Parameters:
        `in` - input stream
        `out` - output stream
      Throws:
        `IOException` - if I/O error occurred

    - #### writeTo

          public static CompletionStage<Void> writeTo​(InputStream in,
                                                      AsyncOutputStream out)

      Parameters:
        `in` - input stream
        `out` - output stream
      Throws:
        `IOException` - if I/O error occurred

    - #### asyncRead

          public static int asyncRead​(InputStream in,
                                      byte[] buf)

    - #### asyncRead

          public static int asyncRead​(InputStream in,
                                      byte[] buf,
                                      int offset,
                                      int length)

    - #### completedException

          public static CompletionStage<Void> completedException​(Throwable t)