public class UESLimitedInputStream
extends java.io.FilterInputStream
Modifier and Type | Field and Description |
---|---|
private long |
count
The current number of bytes.
|
private static long |
DEFAULT_SIZE_LIMIT
The default limit.
|
private long |
sizeLimit
The maximum size of the stream, in bytes.
|
Constructor and Description |
---|
UESLimitedInputStream(java.io.InputStream inStream)
Constructs the limited input stream.
|
UESLimitedInputStream(java.io.InputStream inStream,
Constructs the limited input stream.
|
Modifier and Type | Method and Description |
---|---|
private void |
checkLimit()
Checks if the stream size has been exceeded, throws an exception in that case.
|
int |
read() |
int |
read(byte[] b, |
inStream
- a stream to be limited in sizeinStream
- a stream to be limited in sizesizeLimit
- the limitjava.io.IOException
- when the stream size has been exceededread
in class java.io.FilterInputStream
java.io.IOException
read
in class java.io.FilterInputStream
java.io.IOException