public class CollectingOutputStream extends FilterOutputStream
out| Constructor and Description |
|---|
CollectingOutputStream(OutputStream out)
Create a collecting stream which is set to collect from the get go
|
CollectingOutputStream(OutputStream out,
boolean collecting)
Create a collecting stream
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getCollectedBytes()
Get the collected bytes as a byte array
|
boolean |
isCollecting()
True if we are currently collecting bytes
|
void |
setCollecting(boolean collecting)
Cganeg the state of collecting bytes
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int toWrite) |
close, flushpublic CollectingOutputStream(OutputStream out)
out - the output stream to forward/collectpublic CollectingOutputStream(OutputStream out, boolean collecting)
out - the output stream to forward/collectcollecting - whether the initial state is collecting or notpublic void write(int toWrite)
throws IOException
write in class FilterOutputStreamIOExceptionpublic void write(byte[] b)
throws IOException
write in class FilterOutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class FilterOutputStreamIOExceptionpublic byte[] getCollectedBytes()
public boolean isCollecting()
public void setCollecting(boolean collecting)
collecting - true to collectCopyright © 2025. All rights reserved.