public final class NoThrowOutputStream
extends java.io.OutputStream
IOException
s
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.
Modifier and Type | Class and Description |
---|---|
static class |
NoThrowOutputStream.HiddenException |
Constructor and Description |
---|
NoThrowOutputStream(java.io.OutputStream underlying) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
long |
getBytesWritten() |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
public void flush()
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
public void write(byte[] b, int off, int len)
write
in class java.io.OutputStream
public void write(byte[] b)
write
in class java.io.OutputStream
public void write(int b)
write
in class java.io.OutputStream
public long getBytesWritten()