public class CollectingInputStream extends FilterInputStream
in| Constructor and Description |
|---|
CollectingInputStream(InputStream in)
Create a collecting stream which is set to collect from the get go
|
CollectingInputStream(InputStream in,
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
|
int |
read() |
int |
read(@NotNull byte[] b) |
int |
read(@NotNull byte[] b,
int off,
int len) |
void |
setCollecting(boolean collecting)
Cganeg the state of collecting bytes
|
long |
skip(long n) |
available, close, mark, markSupported, resetpublic CollectingInputStream(InputStream in)
in - the input stream to forward/collectpublic CollectingInputStream(InputStream in, boolean collecting)
in - the input stream to forward/collectcollecting - whether the initial state is collecting or notpublic int read()
throws IOException
read in class FilterInputStreamIOExceptionpublic int read(@NotNull
@NotNull byte[] b)
throws IOException
read in class FilterInputStreamIOExceptionpublic int read(@NotNull
@NotNull byte[] b,
int off,
int len)
throws IOException
read in class FilterInputStreamIOExceptionpublic long skip(long n)
throws IOException
skip in class FilterInputStreamIOExceptionpublic byte[] getCollectedBytes()
public boolean isCollecting()
public void setCollecting(boolean collecting)
collecting - true to collectCopyright © 2023. All rights reserved.