Class StreamBuffer

java.lang.Object
java.io.OutputStream
io.inversion.utils.StreamBuffer
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class StreamBuffer extends OutputStream
Uses an in memory buffer to hold output until bufferSize data is written then will switch over to writing everything to a temp file. You get the data back by calling getInputStream() which can be called multiple times, each time returning a new InputStream with all the data. Calling getInputStream() will close the OutputStream and prevent additional writing.