Package com.dropbox.core
Class NoThrowInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.dropbox.core.NoThrowInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public final class NoThrowInputStream extends java.io.InputStreamWraps an existing input stream, converting all the underlying stream'sIOExceptions to our ownNoThrowInputStream.HiddenException, which is a subclass ofRuntimeException. This means that the methods don't haveIOExceptionin theirthrowsclauses.NOTE: The name is slightly misleading in that these methods still might throw an
IOExceptionwrapped in aHiddenException, just not anIOExceptiondirectly.Also, it does have
IOExceptionin thethrowsclause ofclose(), but you're not supposed to call that method.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNoThrowInputStream.HiddenException
-
Constructor Summary
Constructors Constructor Description NoThrowInputStream(java.io.InputStream underlying)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()longgetBytesRead()intread()intread(byte[] b)intread(byte[] b, int off, int len)
-
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream
-
read
public int read()
- Specified by:
readin classjava.io.InputStream
-
read
public int read(byte[] b, int off, int len)- Overrides:
readin classjava.io.InputStream
-
read
public int read(byte[] b)
- Overrides:
readin classjava.io.InputStream
-
getBytesRead
public long getBytesRead()
-
-