src/main/java/org/jboss/util/stream/NotifyingBufferedOutputStream.java
/**
    * Checks whether a notification is required and
    * notifies as appropriate
    *
    * @param result the number of bytes written
    */
Checks whether a notification is required and
notifies as appropriate

@param result the number of bytes written
Checks whether a notification is required and notifies as appropriate @param result the number of bytes written
public void checkNotification(int result)
   {
      chunk += result;
      if (chunk >= chunkSize)
      {
         if (listener != null)
            listener.onStreamNotification(this, chunk);
         chunk = 0;
      }
   }
public void checkNotification ( int result ) { chunk += result ; if ( chunk >= chunkSize ) { if ( listener != null ) listener . onStreamNotification ( this , chunk ) ; chunk = 0 ; } }
Checks whether a notification is required and
 notifies as appropriate
Checks whether a notification is required and notifies as appropriate
// Is a notification required? // Start a new chunk