/** * @param progressWatchers * all the watchers involved in the same byte transfer operation. * @return * the total number of bytes already transferred. */ public static long sumBytesTransferred(BytesProgressWatcher[] progressWatchers) { long sumOfBytes = 0; for (int i = 0; i < progressWatchers.length; i++) { sumOfBytes += progressWatchers[i].getBytesTransferred(); } return sumOfBytes; }
/** * @param progressWatchers * all the watchers involved in the same byte transfer operation. * @return * the total number of bytes already transferred. */ public static long sumBytesTransferred(BytesProgressWatcher[] progressWatchers) { long sumOfBytes = 0; for (int i = 0; i < progressWatchers.length; i++) { sumOfBytes += progressWatchers[i].getBytesTransferred(); } return sumOfBytes; }
@Override public void updateBytesTransferred(long byteCount) { super.updateBytesTransferred(byteCount); printProgressLine("Comparing files: " + byteFormatter.formatByteSize(super.getBytesTransferred())); } };
@Override public void updateBytesTransferred(long byteCount) { super.updateBytesTransferred(byteCount); printProgressLine("Comparing files: " + byteFormatter.formatByteSize(super.getBytesTransferred())); } };
private String formatBytesProgressWatcherDetails(BytesProgressWatcher watcher, boolean includeBytes) { long secondsRemaining = watcher.getRemainingTime(); String detailsText = (includeBytes ? byteFormatter.formatByteSize(watcher.getBytesTransferred()) + " of " + byteFormatter.formatByteSize(watcher.getBytesToTransfer()) + " - " : "") + "Time remaining: " + timeFormatterTerse.formatTime(secondsRemaining); return detailsText; }
private String formatBytesProgressWatcherDetails(BytesProgressWatcher watcher, boolean includeBytes) { long secondsRemaining = watcher.getRemainingTime(); String detailsText = (includeBytes ? byteFormatter.formatByteSize(watcher.getBytesTransferred()) + " of " + byteFormatter.formatByteSize(watcher.getBytesToTransfer()) + " - " : "") + "Time remaining: " + timeFormatter.formatTime(secondsRemaining); return detailsText; }
private String formatBytesProgressWatcherDetails(BytesProgressWatcher watcher, boolean includeBytes) { long secondsRemaining = watcher.getRemainingTime(); String detailsText = (includeBytes ? byteFormatter.formatByteSize(watcher.getBytesTransferred()) + " of " + byteFormatter.formatByteSize(watcher.getBytesToTransfer()) + " - " : "") + "Time remaining: " + timeFormatter.formatTime(secondsRemaining); return detailsText; }
private String formatBytesProgressWatcherDetails(BytesProgressWatcher watcher, boolean includeBytes) { long secondsRemaining = watcher.getRemainingTime(); String detailsText = (includeBytes ? byteFormatter.formatByteSize(watcher.getBytesTransferred()) + " of " + byteFormatter.formatByteSize(watcher.getBytesToTransfer()) + " - " : "") + "Time remaining: " + timeFormatterTerse.formatTime(secondsRemaining); return detailsText; }