Package com.uppaal.model.io2
Class CachedOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.BufferedOutputStream
com.uppaal.model.io2.CachedOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class CachedOutputStream extends BufferedOutputStream
CachedOutputStream buffers the stream while ignoring flushing.
The content is flushed only upon close, so REMEMBER TO CLOSE IT.
The purpose is to work around networked file systems which tend to
flush too often and result in unbearably poor performance.
Example: Microsoft DFS takes ~45s to save 65K xml document.
- Author:
- marius
-
Field Summary
-
Constructor Summary
Constructors Constructor Description CachedOutputStream(File file)CachedOutputStream(File file, int size)CachedOutputStream(OutputStream out)CachedOutputStream(OutputStream out, int size) -
Method Summary
-
Constructor Details
-
Method Details
-
flush
public void flush()- Specified by:
flushin interfaceFlushable- Overrides:
flushin classBufferedOutputStream
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterOutputStream- Throws:
IOException
-