Modifier and Type | Field and Description |
---|---|
private static final int |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public static void | readFully(InputStream
Whence to read in, byte[] The byte array to fill b, int Position in byte array where we should start writing offset, int Number of bytes to read len)Read a number of bytes into an array. |
public static int | Returns: the number of bytes readWhence to read in, byte[] The byte array to fill b, int Position in byte array where we should start writing offset, int Number of bytes to read len)Read a number of bytes into an array. |
public static int | Returns: the byteWhence to read a byte in)Read an unsigned byte from an InputStream, throwing an EOFException if the end of the input is reached. |
public static void | skipFully(InputStream
InputStream to be skipped. is, long number of bytes to skip. if skippedBytes >= zero, do nothing. skippedBytes)Skips requested number of bytes, throws EOFException if there is too few bytes in the stream. |
public static final long | Returns: The number of bytes skipped.byte stream in, long the number of bytes to skip bytesToSkip)Tries harder to skip the requested number of bytes. |
public static long | Returns: number of bytes skipped in fact.InputStream to be skipped. is)Skips until EOF, returns number of bytes skipped. |
SKIP_FRAGMENT_SIZE | back to summary |
---|---|
private static final int SKIP_FRAGMENT_SIZE |
InputStreamUtil | back to summary |
---|---|
public InputStreamUtil() |
readFully | back to summary |
---|---|
public static void readFully(InputStream in, byte[] b, int offset, int len) throws IOException Read a number of bytes into an array.
|
readLoop | back to summary |
---|---|
public static int readLoop(InputStream in, byte[] b, int offset, int len) throws IOException Read a number of bytes into an array. Keep reading in a loop until len bytes are read or EOF is reached or an exception is thrown. Return the number of bytes read. (InputStream.read(byte[],int,int) does not guarantee to read len bytes even if it can do so without reaching EOF or raising an exception.)
|
readUnsignedByte | back to summary |
---|---|
public static int readUnsignedByte(InputStream in) throws IOException Read an unsigned byte from an InputStream, throwing an EOFException if the end of the input is reached.
|
skipFully | back to summary |
---|---|
public static void skipFully(InputStream is, long skippedBytes) throws IOException Skips requested number of bytes, throws EOFException if there is too few bytes in the stream.
|
skipPersistent | back to summary |
---|---|
public static final long skipPersistent(InputStream in, long bytesToSkip) throws IOException Tries harder to skip the requested number of bytes. Note that even if the method fails to skip the requested number of bytes, it will not throw an exception. If this happens, the caller can be sure that end-of-stream has been reached.
|
skipUntilEOF | back to summary |
---|---|
public static long skipUntilEOF(InputStream is) throws IOException Skips until EOF, returns number of bytes skipped.
|