You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
884 B

package com.archive.common.archiveUtil;
public class FileUtils
{
public static String changeValueType(Long dataSize) {
String valueType = new String();
String[] type = { "KB", "MB", "GB", "TB", "PB" };
int p = 0;
if (dataSize.longValue() == 0L) {
valueType = dataSize + type[p];
} else {
Double value = Double.valueOf(dataSize.longValue() * 1.0D / 1024.0D);
while (value.doubleValue() >= 1024.0D) {
value = Double.valueOf(value.doubleValue() / 1024.0D);
p++;
}
valueType = String.format("%.2f", new Object[] { value }) + type[p];
}
return valueType;
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\archiveUtil\FileUtils.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/