Save This Page
Home » jboss-5.0.0.CR1-src » org » jboss » util » stream » [javadoc | source]
org.jboss.util.stream
public class: NotifyingBufferedInputStream [javadoc | source]
java.lang.Object
   java.io.InputStream
      java.io.FilterInputStream
         java.io.BufferedInputStream
            org.jboss.util.stream.NotifyingBufferedInputStream

All Implemented Interfaces:
    Closeable

A buffered input stream that notifies every "chunk"
Field Summary
 int chunkSize    The number of bytes between notifications 
 int chunk    The number of bytes read in the current chunk 
 StreamListener listener    The listener notified every chunk 
Constructor:
 public NotifyingBufferedInputStream(InputStream is,
    int size,
    int chunkSize,
    StreamListener 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
Method from org.jboss.util.stream.NotifyingBufferedInputStream Summary:
checkNotification,   read,   read,   setStreamListener
Methods from java.io.BufferedInputStream:
available,   close,   mark,   markSupported,   read,   read,   reset,   skip
Methods from java.io.FilterInputStream:
available,   close,   mark,   markSupported,   read,   read,   read,   reset,   skip
Methods from java.io.InputStream:
available,   close,   mark,   markSupported,   read,   read,   read,   reset,   skip
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jboss.util.stream.NotifyingBufferedInputStream Detail:
 public  void checkNotification(int result) 
    Checks whether a notification is required and notifies as appropriate
 public int read() throws IOException 
 public int read(byte[] b,
    int off,
    int len) throws IOException 
 public  void setStreamListener(StreamListener listener)