public abstract class ThresholdingInputStream
extends java.io.FilterInputStream
Constructor and Description |
---|
ThresholdingInputStream(java.io.InputStream in,
int thresholdBytes) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkThreshold()
Checks whether reading count bytes would cross the limit.
|
int |
getThreshold() |
void |
mark(int readlimit) |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
void |
reset() |
long |
skip(long n) |
protected abstract void |
thresholdReached(int current)
Called when the threshold is about to be exceeded.
|
public ThresholdingInputStream(java.io.InputStream in, int thresholdBytes)
public void mark(int readlimit)
mark
in class java.io.FilterInputStream
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public int read(byte[] b) throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public int read() throws java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException
public void reset() throws java.io.IOException
reset
in class java.io.FilterInputStream
java.io.IOException
public long skip(long n) throws java.io.IOException
skip
in class java.io.FilterInputStream
java.io.IOException
protected void checkThreshold() throws java.io.IOException
java.io.IOException
public int getThreshold()
protected abstract void thresholdReached(int current) throws java.io.IOException
current
- is the current number of bytes that have been writtenjava.io.IOException