public final class Streams extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
copy(InputStream inputStream,
OutputStream outputStream)
Copies the
inputStream into the outputSteam and finally
closes the both streams. |
static String |
readAll(InputStream inputStream)
Deprecated.
it is always safer to supply a charset. See
readAll(InputStream, Charset). |
static String |
readAll(InputStream inputStream,
Charset charset)
Reads all input into memory, close the steam, and return as a String.
|
static InputStream |
wrapString(String str)
Deprecated.
it is always safer to supply a charset. See
wrapString(String, Charset). |
static InputStream |
wrapString(String str,
Charset charset)
Wraps the provided string into an InputStream.
|
static void |
write(String str,
OutputStream outputStream)
Deprecated.
it is always safer to supply a charset. See
write(String, OutputStream, Charset). |
static void |
write(String str,
OutputStream outputStream,
Charset charset)
Writes the specified string to stream with buffering and closes the stream.
|
@Deprecated public static InputStream wrapString(String str)
wrapString(String, Charset).str - String to wrap.public static InputStream wrapString(String str, Charset charset)
str - String to wrap.charset - the chareset encoding of the string@Deprecated public static String readAll(InputStream inputStream) throws IOException
readAll(InputStream, Charset).inputStream - InputStream to read from.IOException - if there is an problem reading from the stream.public static String readAll(InputStream inputStream, Charset charset) throws IOException
inputStream - InputStream to read from.charset - the charset to interpret the input as.IOException - if there is an problem reading from the stream.@Deprecated public static void write(String str, OutputStream outputStream) throws IOException
write(String, OutputStream, Charset).str - String to write.outputStream - Stream to write to.IOException - If there is an exception while writing.public static void write(String str, OutputStream outputStream, Charset charset) throws IOException
str - String to write.outputStream - Stream to write to.charset - The charset to write in.IOException - If there is an exception while writing.public static void copy(InputStream inputStream, OutputStream outputStream) throws IOException
inputStream into the outputSteam and finally
closes the both streams.IOExceptionCopyright © 2015. All Rights Reserved.