~ubuntu-branches/ubuntu/quantal/commons-io/quantal

« back to all changes in this revision

Viewing changes to src/java/org/apache/commons/io/output/ThresholdingOutputStream.java

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2008-02-21 13:26:43 UTC
  • mfrom: (1.1.3 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080221132643-p4c8f8lhb9rnqnlo
Tags: 1.4-1
* New upstream release
* Bump Standards-Version to 3.7.3
* Bump up debhelper compat to 6
* Replace XS-Vcs headers with Vcs
* debian/patches:
  - remove 01_no_ext_links.dpatch - not required
  - remove 02_no_mkdir_in_homedir.dpatch - not required
* Remove dpatch from Build-Depends
* Update debian/rules and debian/libcommons-io-java-doc.install
  with new target dirs
* debian/copyright: add copyright notice

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
 *
37
37
 * @author <a href="mailto:martinc@apache.org">Martin Cooper</a>
38
38
 *
39
 
 * @version $Id: ThresholdingOutputStream.java 437680 2006-08-28 11:57:00Z scolebourne $
 
39
 * @version $Id: ThresholdingOutputStream.java 540714 2007-05-22 19:39:44Z niallp $
40
40
 */
41
41
public abstract class ThresholdingOutputStream
42
42
    extends OutputStream
217
217
    {
218
218
        if (!thresholdExceeded && (written + count > threshold))
219
219
        {
 
220
            thresholdExceeded = true;
220
221
            thresholdReached();
221
 
            thresholdExceeded = true;
222
222
        }
223
223
    }
224
224
 
 
225
    /**
 
226
     * Resets the byteCount to zero.  You can call this from 
 
227
     * {@link #thresholdReached()} if you want the event to be triggered again. 
 
228
     */
 
229
    protected void resetByteCount() 
 
230
    {
 
231
        this.thresholdExceeded = false;
 
232
        this.written = 0;
 
233
    }
225
234
 
226
235
    // ------------------------------------------------------- Abstract methods
227
236