public NotifyingBufferedInputStream(InputStream is,
int size,
int chunkSize,
StreamListener listener) {
super(is, size);
if (chunkSize < = size)
throw new IllegalArgumentException("chunkSize must be bigger than the buffer");
this.chunkSize = chunkSize;
this.listener = listener;
}
Construct a notifying buffered inputstream.
The listener is notified once every chunk. Parameters:
is - the input stream to be buffered
size - the buffer size
chunkSize - the chunk size
listener - the listener to notify
Throws:
IllegalArgumentException - for a size <= 0 or chunkSize <= size
- exception:
IllegalArgumentException - for a size <= 0 or chunkSize <= size
|