public class UESLimitedOutputStream
extends java.io.FilterOutputStream
| 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 |
|---|
UESLimitedOutputStream(java.io.OutputStream outStream)
Constructs the limited output stream.
|
UESLimitedOutputStream(java.io.OutputStream outStream,
Constructs the limited output stream.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
checkLimit()
Checks if the stream size has been exceeded, throws an exception in that case.
|
void |
write(int b)
No need to overwrite these 2 methods - all physical writes goes through write(int b), where the limit could be checked.
|
outStream - a stream to be limited in sizeoutStream - a stream to be limited in sizesizeLimit - the limitjava.io.IOException - when the stream size has been exceededwrite in class java.io.FilterOutputStreamjava.io.IOException