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 String |
format(Long size,
DataUnit fileDataUnit)
根据单位,将文件大小转换为对应单位的大小
|
static long |
parse(String text)
解析数据大小字符串,转换为bytes大小
|
public static long parse(String text)
text - 数据大小字符串,类似于:12KB, 5MB等public static String format(long size)
size - Long类型大小Copyright © 2025. All rights reserved.