public class StreamUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
bytes(InputStream in) |
static byte[] |
bytes(InputStream in,
int bufferSize)
get bytes from InputStream
|
static void |
close(Closeable... in) |
static void |
close(Closeable in) |
static void |
close(Iterable<Closeable> iterable) |
static OutputStream |
compress(OutputStream out,
Compression compression) |
static int |
copy(InputStream in,
OutputStream out) |
static int |
copy(InputStream in,
OutputStream out,
int bufferSize) |
static InputStream |
decompress(InputStream in,
Compression compression) |
static boolean |
equals(InputStream i1,
InputStream i2) |
static boolean |
equals(InputStream i1,
InputStream i2,
int buf) |
static void |
readFully(InputStream in,
byte[] b) |
static void |
readFully(InputStream in,
byte[] b,
int off,
int len) |
static String |
string(InputStream in) |
static String |
string(InputStream in,
Charset charset) |
static String |
string(InputStream in,
Charset charset,
int bufferSize) |
public static String string(InputStream in) throws IOException
IOExceptionpublic static String string(InputStream in, Charset charset) throws IOException
IOExceptionpublic static String string(InputStream in, Charset charset, int bufferSize) throws IOException
IOExceptionpublic static int copy(InputStream in, OutputStream out) throws IOException
IOExceptionpublic static int copy(InputStream in, OutputStream out, int bufferSize) throws IOException
IOExceptionpublic static InputStream decompress(InputStream in, Compression compression) throws IOException
in - compression - IOExceptionIllegalArgumentException - if compression none of Compression.BZIP2,
Compression.GZIP, Compression.NONEpublic static OutputStream compress(OutputStream out, Compression compression) throws IOException
IOExceptionpublic static void close(Closeable... in)
public static void close(Closeable in)
public static byte[] bytes(InputStream in) throws IOException
IOExceptionpublic static byte[] bytes(InputStream in, int bufferSize) throws IOException
in - bufferSize - IOExceptionpublic static void readFully(InputStream in, byte[] b) throws EOFException, IOException
EOFExceptionIOExceptionpublic static void readFully(InputStream in, byte[] b, int off, int len) throws EOFException, IOException
EOFExceptionIOExceptionpublic static boolean equals(InputStream i1, InputStream i2) throws IOException
IOExceptionpublic static boolean equals(InputStream i1, InputStream i2, int buf) throws IOException
IOExceptionCopyright © 2014 Molindo GmbH. All Rights Reserved.