public class IOUtils
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
private |
IOUtils() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
getStreamAsByteArray(java.io.InputStream stream)
Returns the contents of the input stream as byte array.
|
static byte[] |
getStreamAsByteArray(java.io.InputStream stream,
int length)
Returns the contents of the input stream as byte array.
|
static int |
readFully(java.io.InputStream in,
byte[] b)
Reads into a byte array.
|
static int |
readFully(java.io.InputStream in,
byte[] b,
int off,
int len)
Same as the normal in.read(b, off, len), but tries to ensure that the entire len
number of bytes is read.
|
public static int readFully(java.io.InputStream in,
byte[] b)
throws java.io.IOException
java.io.IOExceptionreadFully(java.io.InputStream, byte[], int, int)public static int readFully(java.io.InputStream in,
byte[] b,
int off,
int len)
throws java.io.IOException
java.io.IOExceptionpublic static byte[] getStreamAsByteArray(java.io.InputStream stream)
throws java.io.IOException
stream - the InputStreamjava.io.IOExceptionpublic static byte[] getStreamAsByteArray(java.io.InputStream stream,
int length)
throws java.io.IOException
stream - the InputStreamlength - the number of bytes to copy, if length < 0, the number is unlimitedjava.io.IOException