public final class NoThrowOutputStream
extends java.io.OutputStream
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.
| 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.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreampublic void flush()
flush in interface java.io.Flushableflush in class java.io.OutputStreampublic void write(byte[] b,
int off,
int len)
write in class java.io.OutputStreampublic void write(byte[] b)
write in class java.io.OutputStreampublic void write(int b)
write in class java.io.OutputStreampublic long getBytesWritten()