org.eclipse.jgit.util.io
Class SafeBufferedOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.BufferedOutputStream
org.eclipse.jgit.util.io.SafeBufferedOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
public class SafeBufferedOutputStream
- extends BufferedOutputStream
A BufferedOutputStream that throws an error if the final flush fails on
close.
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.
Method Summary |
void |
close()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SafeBufferedOutputStream
public SafeBufferedOutputStream(OutputStream out)
- Parameters:
out
- underlying output stream- See Also:
BufferedOutputStream.BufferedOutputStream(OutputStream)
SafeBufferedOutputStream
public SafeBufferedOutputStream(OutputStream out,
int size)
- Parameters:
out
- underlying output streamsize
- buffer size- See Also:
BufferedOutputStream.BufferedOutputStream(OutputStream, int)
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class FilterOutputStream
- Throws:
IOException
Copyright © 2012. All Rights Reserved.