public class StreamUtils
extends java.lang.Object
| Constructor and Description |
|---|
StreamUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeSilently(java.io.Closeable stream)
Closes a stream, without throwing IOException.
|
static void |
copyStream(java.io.InputStream input,
java.io.OutputStream output)
Copy an input stream's contents into an output stream.
|
static java.lang.String |
readStreamAsString(java.io.InputStream stream) |
static java.lang.String |
readStreamAsString(java.io.InputStream stream,
boolean includeEndOfLines) |
static java.lang.String |
readStreamAsString(java.io.InputStream stream,
boolean includeEndOfLines,
java.lang.String encoding) |
static java.lang.String |
readStreamAsString(java.io.InputStream stream,
java.lang.String encoding) |
public static void closeSilently(java.io.Closeable stream)
stream - the stream that will be closedpublic static void copyStream(java.io.InputStream input,
java.io.OutputStream output)
throws java.io.IOException
input - input streamoutput - stream where to copy inputjava.io.IOException - if IO failspublic static java.lang.String readStreamAsString(java.io.InputStream stream)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String readStreamAsString(java.io.InputStream stream,
java.lang.String encoding)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String readStreamAsString(java.io.InputStream stream,
boolean includeEndOfLines)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String readStreamAsString(java.io.InputStream stream,
boolean includeEndOfLines,
java.lang.String encoding)
throws java.io.IOException
java.io.IOException