public final class NoThrowInputStream extends InputStream
IOException
s
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(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) |
available, mark, markSupported, reset, skip
public NoThrowInputStream(InputStream underlying)
public void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
public int read()
read
in class InputStream
public int read(byte[] b, int off, int len)
read
in class InputStream
public int read(byte[] b)
read
in class InputStream
public long getBytesRead()