public class StreamUtils extends Object
| Constructor and Description |
|---|
StreamUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
toString(InputStream byteStream)
Decodes the contents of the provided
InputStream into a
String using the UTF-8 charset. |
static String |
toString(InputStream byteStream,
String charsetName)
Decodes the contents of the provided
InputStream into a
String using the charset denoted by the charsetName parameter. |
public static String toString(InputStream byteStream) throws IOException
InputStream into a
String using the UTF-8 charset.byteStream - The InputStream to decode.String representation of the stream's contents.IOExceptionpublic static String toString(InputStream byteStream, String charsetName) throws IOException
InputStream into a
String using the charset denoted by the charsetName parameter.byteStream - The InputStream to decode.charsetName - The charset used to decode the stream.String representation of the stream's contents.IOException