Package com.dropbox.core
Class NoThrowInputStream
java.lang.Object
java.io.InputStream
com.dropbox.core.NoThrowInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
Wraps an existing input stream, converting all the underlying stream's
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.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
NoThrowInputStream
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream
-
read
public int read()- Specified by:
readin classInputStream
-
read
public int read(byte[] b, int off, int len) - Overrides:
readin classInputStream
-
read
public int read(byte[] b) - Overrides:
readin classInputStream
-
getBytesRead
public long getBytesRead()
-