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