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.FilterInputStreampublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionpublic int read(byte[] b)
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionpublic int read()
throws java.io.IOException
read in class java.io.FilterInputStreamjava.io.IOExceptionpublic void reset()
throws java.io.IOException
reset in class java.io.FilterInputStreamjava.io.IOExceptionpublic long skip(long n)
throws java.io.IOException
skip in class java.io.FilterInputStreamjava.io.IOExceptionprotected void checkThreshold()
throws java.io.IOException
java.io.IOExceptionpublic 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