Closeable, Flushable, AutoCloseablepublic class SafeBufferedOutputStream extends BufferedOutputStream
Java's BufferedOutputStream swallows errors that occur when the output stream tries to write the final bytes to the output during close. This may result in corrupted files without notice.
buf, countout| Constructor | Description |
|---|---|
SafeBufferedOutputStream(OutputStream out) |
|
SafeBufferedOutputStream(OutputStream out,
int size) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
flush, write, writewritepublic SafeBufferedOutputStream(OutputStream out)
out - underlying output streamBufferedOutputStream(OutputStream)public SafeBufferedOutputStream(OutputStream out, int size)
out - underlying output streamsize - buffer sizeBufferedOutputStream(OutputStream, int)public void close()
throws IOException
close in interface AutoCloseableclose in interface Closeableclose in class FilterOutputStreamIOExceptionCopyright © 2018. All rights reserved.