public class DataSizeUtil extends Object
Constructor and Description |
---|
DataSizeUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
format(long size)
可读的文件大小
参考 http://stackoverflow.com/questions/3263892/format-file-size-as-mb-gb-etc |
static long |
parse(String text)
解析数据大小字符串,转换为bytes大小
|
public static long parse(String text)
text
- 数据大小字符串,类似于:12KB, 5MB等public static String format(long size)
size
- Long类型大小Copyright © 2024. All rights reserved.