code: protected void checkThreshold (final int nCount) throws IOException
    {
      if (!m_bThresholdExceeded && (m_nWritten + nCount > m_nThreshold))
      {
        m_bThresholdExceeded = true;
        onThresholdReached ();
      }
    }
docs: Checks to see if writing the specified number of bytes would cause the
  configured threshold to be exceeded. If so, triggers an event to allow a
  concrete implementation to take action on
  
  @param nCount
  The number of bytes about to be written to the underlying output
  stream.
  @exception IOException
  if an error occurs.