public class StreamUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
lineSeparator |
| Constructor and Description |
|---|
StreamUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
copy(java.io.InputStream inputStream,
java.io.OutputStream outputStream) |
static java.lang.String |
getLineSeparator() |
static java.lang.String |
getReaderContents(java.io.Reader reader)
Reads all the characters into a String.
|
static java.lang.String |
getStreamContents(java.io.InputStream ins)
Reads a stream until the end of file into a String and uses the machines
default encoding to convert to characters the bytes from the Stream.
|
static java.lang.String |
getStreamContents(java.io.InputStream ins,
java.lang.String charsetName)
Reads a stream until the end of file into a String and uses the machines
default encoding to convert to characters the bytes from the Stream.
|
public static java.lang.String getLineSeparator()
public static java.lang.String getStreamContents(java.io.InputStream ins)
throws java.io.IOException
ins - The InputStream to read.java.io.IOException - If there is an error reading the stream.public static java.lang.String getStreamContents(java.io.InputStream ins,
java.lang.String charsetName)
throws java.io.IOException
ins - The InputStream to read.charsetName - The name of a supported charsetjava.io.IOException - If there is an error reading the stream.public static java.lang.String getReaderContents(java.io.Reader reader)
throws java.io.IOException
reader - The Reader to read.java.io.IOException - If there is an error reading the stream.public static void copy(java.io.InputStream inputStream,
java.io.OutputStream outputStream)
throws java.io.IOException
java.io.IOException