public 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 and Description |
|---|
SafeBufferedOutputStream(OutputStream out) |
SafeBufferedOutputStream(OutputStream out,
int size) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
flush, write, writewritepublic SafeBufferedOutputStream(OutputStream out)
out - underlying output streamBufferedOutputStream.BufferedOutputStream(OutputStream)public SafeBufferedOutputStream(OutputStream out, int size)
out - underlying output streamsize - buffer sizeBufferedOutputStream.BufferedOutputStream(OutputStream, int)public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class FilterOutputStreamIOExceptionCopyright © 2014. All rights reserved.