public class HumanReadableSize extends Object
| Constructor and Description |
|---|
HumanReadableSize(long value) |
HumanReadableSize(String humanReadable) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
String |
getHumanReadable() |
long |
getValue() |
int |
hashCode() |
static long |
parse(String humanReadableSize)
将易读的字节数转换成真实字节数。
1 转换成 1。
1K 转换成 1024。
1M 转换成 1048576。
1G 转换成 1073741824。
1T 转换成 1099511627776。
支持小数点,例如:1.5K。
|
static String |
toHumanReadble(long size)
将字节数取整,并转换成易读的概要字节数。
1转换成1。
1024转换成1K。
1048576转换成1M。
1073741824转换成1G。
1099511627776转换成1T。
小于0的一律转换成n/a。
|
String |
toString() |
public HumanReadableSize(String humanReadable)
public HumanReadableSize(long value)
public static long parse(String humanReadableSize)
1 转换成 1。1K 转换成 1024。1M 转换成 1048576。1G 转换成 1073741824。1T 转换成 1099511627776。1.5K。public static String toHumanReadble(long size)
1转换成1。1024转换成1K。1048576转换成1M。1073741824转换成1G。1099511627776转换成1T。0的一律转换成n/a。public long getValue()
public String getHumanReadable()
Copyright © 2006–2018 TinyGroup. All rights reserved.