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 Details

    • 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, jakarta.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<jakarta.ws.rs.core.MediaType> getAvailableMediaTypes(String[] mediaTypes)
      Parameters:
      mediaTypes - string array of media types
      Returns:
      list of media types
    • getAvailableVariants

      public static List<jakarta.ws.rs.core.Variant> getAvailableVariants(String[] mediaTypes)
      Parameters:
      mediaTypes - string array of media types
      Returns:
      list of Variant
    • getAvailableVariants

      public static List<jakarta.ws.rs.core.Variant> getAvailableVariants(List<jakarta.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)