public class StreamUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
copy(InputStream is, OutputStream os)
Copies the InputStream to the OutputStream using a 4k buffer.
|
static void |
copy(InputStream is, OutputStream os, int size)
Copies the InputStream to the OutputStream using a defined buffer size in bytes.
|
static void |
copy(Reader in, Writer out)
Copies a Reader to a Writer with an 4096 char buffer.
|
static void |
copy(Reader in, Writer out, int size)
Copies a Reader to a Writer with a buffer of
size characters. |
static int |
fill(byte[] buffer, InputStream is)
Reads data from the InputStream and tries to fill the buffer.
|
static InputStream |
getPartitionedInputStream(InputStream is, int len)
Returns an InputStream that is a partition of another InputStream.
|
static String |
toString(InputStream is, String encoding)
Returns a string representation of this input stream.
|
public static void copy(InputStream is, OutputStream os) throws IOException
is -os -IOExceptionpublic static void copy(InputStream is, OutputStream os, int size) throws IOException
is -os -size -IOExceptionpublic static void copy(Reader in, Writer out) throws IOException
in -out -IOExceptionpublic static void copy(Reader in, Writer out, int size) throws IOException
size characters.in -out -size -IOException
public static int fill(byte[] buffer,
InputStream is)
throws IOException
buffer -is -IOExceptionpublic static InputStream getPartitionedInputStream(InputStream is, int len)
is -len -public static String toString(InputStream is, String encoding)
is -