public class NotifyingBufferedOutputStream extends BufferedOutputStream
buf, countout| Constructor and Description |
|---|
NotifyingBufferedOutputStream(OutputStream os,
int size,
int chunkSize,
StreamListener listener)
Construct a notifying buffered outputstream.
The listener is notified once every chunk. |
| Modifier and Type | Method and Description |
|---|---|
void |
checkNotification(int result)
Checks whether a notification is required and
notifies as appropriate
|
void |
setStreamListener(StreamListener listener) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
flushclose, writepublic NotifyingBufferedOutputStream(OutputStream os, int size, int chunkSize, StreamListener listener)
os - the output stream to be bufferedsize - the buffer sizechunkSize - the chunk sizelistener - IllegalArgumentException - for a size <= 0 or chunkSize <= size or a null listenerpublic void setStreamListener(StreamListener listener)
public void write(int b)
throws IOException
write in class BufferedOutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class BufferedOutputStreamIOExceptionpublic void checkNotification(int result)
result - the number of bytes writtenCopyright © 2015 JBoss by Red Hat. All rights reserved.