Package com.dropbox.core
Class NoThrowOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- com.dropbox.core.NoThrowOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public final class NoThrowOutputStream extends java.io.OutputStreamWraps an existing output stream, converting all the underlying stream'sIOExceptions to our ownNoThrowOutputStream.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 classNoThrowOutputStream.HiddenException
-
Constructor Summary
Constructors Constructor Description NoThrowOutputStream(java.io.OutputStream underlying)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()longgetBytesWritten()voidwrite(byte[] b)voidwrite(byte[] b, int off, int len)voidwrite(int b)
-
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStream
-
flush
public void flush()
- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.OutputStream
-
write
public void write(byte[] b, int off, int len)- Overrides:
writein classjava.io.OutputStream
-
write
public void write(byte[] b)
- Overrides:
writein classjava.io.OutputStream
-
write
public void write(int b)
- Specified by:
writein classjava.io.OutputStream
-
getBytesWritten
public long getBytesWritten()
-
-