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 intasyncRead(InputStream in, byte[] buf)static intasyncRead(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 StringreadString(InputStream in)static StringreadString(InputStream in, javax.ws.rs.core.MediaType mediaType)static voidwriteTo(InputStream in, OutputStream out)static CompletionStage<Void>writeTo(InputStream in, AsyncOutputStream out)static CompletionStage<Void>writeToAndCloseInput(InputStream in, AsyncOutputStream out)
-
-
-
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 streammediaType- 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 streamout- output stream- Throws:
IOException- if I/O error occurred
-
writeToAndCloseInput
public static CompletionStage<Void> writeToAndCloseInput(InputStream in, AsyncOutputStream out)
- Parameters:
in- input streamout- output stream- Throws:
IOException- if I/O error occurred
-
writeTo
public static CompletionStage<Void> writeTo(InputStream in, AsyncOutputStream out)
- Parameters:
in- input streamout- 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)
-
-