public final class InputStreams extends Object
Modifier and Type | Field and Description |
---|---|
static int |
BUF_SIZE_16K
16K buffer size.
|
static int |
BUF_SIZE_4K
4K buffer size.
|
static int |
BUF_SIZE_8K
8K buffer size.
|
Modifier and Type | Method and Description |
---|---|
static String |
readAllAsString(InputStream input, int bufsize, Charset charset)
Read all InputStream into a String.
|
static byte[] |
readAllBytes(InputStream input, int bufsize)
Read all InputStream into a byte[].
|
static void |
transferTo(InputStream input, OutputStream output, int bufsize)
Transfer an InputStream to an OutputStream.
|
public static final int BUF_SIZE_4K
public static final int BUF_SIZE_8K
public static final int BUF_SIZE_16K
public static byte[] readAllBytes(InputStream input, int bufsize)
input
- InputStream
bufsize
- Size of the read buffer
UncheckedIOException
- if something goes wrong
public static String readAllAsString(InputStream input, int bufsize, Charset charset)
input
- InputStream
bufsize
- Size of the read buffer
charset
- Charset
UncheckedIOException
- if something goes wrong
public static void transferTo(InputStream input, OutputStream output, int bufsize)
input
- InputStream
output
- OutputStream
bufsize
- Size of the read buffer
UncheckedIOException
- if something goes wrong