/** * Returns the total number of bytes that have been skipped by this job so far. * Bytes are skipped when file transfers are resumed. * * @return the total number of bytes that have been skipped by this job so far */ public long getTotalSkippedByteCount() { return totalSkippedByteCounter.getByteCount(); }
/** * Returns the number of bytes that have been processed in the current file. * * @return the number of bytes that have been processed in the current file */ public long getCurrentFileByteCount() { return currentFileByteCounter.getByteCount(); }
/** * Returns the number of bytes that have been skipped in the current file. Bytes are skipped when file transfers * are resumed. * * @return the number of bytes that have been skipped in the current file */ public long getCurrentFileSkippedByteCount() { return currentFileSkippedByteCounter.getByteCount(); }
/** * Returns the total number of bytes that have been processed by this job so far. * * @return the total number of bytes that have been processed by this job so far */ public long getTotalByteCount() { return totalByteCounter.getByteCount(); }
/** * Return the number of bytes which have been accounted for. */ public synchronized long getByteCount() { if(addedCounter!=null) return count + addedCounter.getByteCount(); return this.count; }
/** * Increases the byte counter by the number of bytes contained in the specified counter (as returned by its * {@link #getByteCount()} method) and resets its byte counter after (if specified). * * @param counter the Bytecounter to add to this one, and reset after (if specified). * @param resetAfter if true, the specified counter will be reset after its byte count has been added to this ByteCounter */ public synchronized void add(ByteCounter counter, boolean resetAfter) { // Hold a lock on the provided counter to make sure that it is not modified or accessed // while this operation is carried out synchronized(counter) { add(counter.getByteCount()); if(resetAfter) counter.reset(); } }