[ https://issues.apache.org/jira/browse/IO-121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Niall Pemberton resolved IO-121. -------------------------------- Resolution: Fixed Fix Version/s: 1.4 Assignee: Niall Pemberton Thanks for the patch - applied in r540644 > Allowing ThesholdingOuputStream to reset written and thresholdExceeded values? > ------------------------------------------------------------------------------ > > Key: IO-121 > URL: https://issues.apache.org/jira/browse/IO-121 > Project: Commons IO > Issue Type: Improvement > Components: Streams/Writers > Affects Versions: 1.3 > Environment: Any > Reporter: Tom Nichols > Assigned To: Niall Pemberton > Priority: Trivial > Fix For: 1.4 > > Attachments: ThresholdingOutputStream.java, TOS-reset.patch > > > please add a protected reset() method to ThresholdingOutputStream that will > reset the byteCount and thresholdExceeded values: > protected void reset() > { > this.thresholdExceeded = false; > this.written = 0; > } > The order of operations for the base checkThreshold(int) method will need to > be changed to allow reset() to be properly called from thresholdReached(): > protected void checkThreshold(int count) throws IOException > { > if (!thresholdExceeded && (written + count > threshold)) > { > thresholdExceeded = true; > thresholdReached(); //call comes _after_ thresholdExceeded = > true. > } > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]