Closeable, Flushable, AutoCloseablepublic final class ReusableBufferedOutputStream extends BufferedOutputStream
BufferedOutputStream with a reset(OutputStream) method
that allows an instance to be re-used with another underlying output stream.buf, countout| Constructor | Description |
|---|---|
ReusableBufferedOutputStream(OutputStream out) |
|
ReusableBufferedOutputStream(OutputStream out,
int size) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
|
void |
reset(OutputStream out) |
Resets this stream and uses the given output stream for writing.
|
flush, write, writewritepublic ReusableBufferedOutputStream(OutputStream out)
public ReusableBufferedOutputStream(OutputStream out, int size)
public void close()
throws IOException
close in interface AutoCloseableclose in interface Closeableclose in class FilterOutputStreamIOExceptionpublic void reset(OutputStream out)
out - New output stream to be used for writing.IllegalStateException - If the stream isn't closed.