public class SafeInputStream extends InputStream
| Constructor and Description |
|---|
SafeInputStream(InputStream inputStream) |
| Modifier and Type | Method and Description |
|---|---|
int |
read() |
void |
readSafe(byte[] buf)
Reads some number of bytes from the underlying input stream and stores
them into the buffer array buf.
|
void |
skipSafe(long numBytes)
Skips over and discards numBytes bytes of data from the underlying input
stream.
|
available, close, mark, markSupported, read, read, reset, skippublic SafeInputStream(InputStream inputStream)
public void readSafe(byte[] buf)
throws IOException
buf - the buffer into which the data is read.IOException - if no bytes could be read from underlying streampublic void skipSafe(long numBytes)
throws IOException
numBytes - the number of bytes to skipIOException - if the given number of bytes could not be skippedpublic int read()
throws IOException
read in class InputStreamIOExceptionCopyright © 2018. All rights reserved.