Package com.dropbox.core
Class NoThrowOutputStream
java.lang.Object
java.io.OutputStream
com.dropbox.core.NoThrowOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
Wraps an existing output stream, converting all the underlying stream's
IOExceptions
to our own NoThrowOutputStream.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.OutputStream
nullOutputStream
-
Constructor Details
-
NoThrowOutputStream
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream
-
flush
public void flush()- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream
-
write
public void write(byte[] b, int off, int len) - Overrides:
writein classOutputStream
-
write
public void write(byte[] b) - Overrides:
writein classOutputStream
-
write
public void write(int b) - Specified by:
writein classOutputStream
-
getBytesWritten
public long getBytesWritten()
-