예제 #1
0
 private static string BytesToString(long bytes)
 {
     if (_useRawReportingUnits)
     {
         return(bytes + "bytes");
     }
     return(ByteUnit.bytesToString(bytes));
 }
예제 #2
0
 internal virtual void PrintProgress()
 {
     if (_output != null)
     {
         char lineSep = _interactive ? '\r' : '\n';
         if (_done)
         {
             _output.println(lineSep + "Done: " + _currentFiles + " files, " + ByteUnit.bytesToString(_currentBytes) + " processed.");
         }
         else if (MaxFiles > 0 && MaxBytes > 0)
         {
             double progress = (_currentBytes / ( double )MaxBytes) * 100;
             _output.print(lineSep + "Files: " + _currentFiles + '/' + MaxFiles + ", data: " + string.Format("{0,4:F1}%", progress));
         }
         else
         {
             _output.print(lineSep + "Files: " + _currentFiles + "/?" + ", data: ??.?%");
         }
     }
 }