private void doit() { boolean changed = false; while ( bytes >= reportSize ) { long b = bytes/reportSize; blocks += (int) b; bytes -= b*reportSize; changed = true; } if (changed) notifyListeners(); } }
/** * Closes the input stream and notifies all listeners. */ public void close() throws IOException { notifyListeners(); super.close(); }