mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-31 10:01:22 +01:00
Attachment download
This commit is contained in:
@@ -67,6 +67,14 @@ public class Helper {
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
static String humanReadableByteCount(long bytes, boolean si) {
|
||||
int unit = si ? 1000 : 1024;
|
||||
if (bytes < unit) return bytes + " B";
|
||||
int exp = (int) (Math.log(bytes) / Math.log(unit));
|
||||
String pre = (si ? "kMGTPE" : "KMGTPE").charAt(exp - 1) + (si ? "" : "i");
|
||||
return String.format("%.1f %sB", bytes / Math.pow(unit, exp), pre);
|
||||
}
|
||||
|
||||
static StringBuilder getDebugInfo() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user