public class NotifyingBufferedOutputStream extends BufferedOutputStream
buf, count
out
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) |
flush
close, write
public 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 BufferedOutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class BufferedOutputStream
IOException
public void checkNotification(int result)
result
- the number of bytes writtenCopyright © 2018 JBoss by Red Hat. All rights reserved.