public final class NoThrowInputStream
extends java.io.InputStream
IOExceptions
to our own NoThrowInputStream.HiddenException, which is a subclass of RuntimeException. This
means that the methods don't have IOException in their throws clauses.
NOTE: The name is slightly misleading in that these methods still might throw an
IOException wrapped in a HiddenException, just not an
IOException directly.
Also, it does have IOException in the throws clause of close(),
but you're not supposed to call that method.
| Modifier and Type | Class and Description |
|---|---|
static class |
NoThrowInputStream.HiddenException |
| Constructor and Description |
|---|
NoThrowInputStream(java.io.InputStream underlying) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
long |
getBytesRead() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreampublic int read()
read in class java.io.InputStreampublic int read(byte[] b,
int off,
int len)
read in class java.io.InputStreampublic int read(byte[] b)
read in class java.io.InputStreampublic long getBytesRead()