Package org.miaixz.bus.core.io.unit
Enum Class DataUnit
- All Implemented Interfaces:
Serializable,Comparable<DataUnit>,Constable
数据单位封装 此类来自于:Spring-framework
BYTES 1B 2^0 1
KILOBYTES 1KB 2^10 1,024
MEGABYTES 1MB 2^20 1,048,576
GIGABYTES 1GB 2^30 1,073,741,824
TERABYTES 1TB 2^40 1,099,511,627,776
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
-
Enum Constant Details
-
BYTES
Bytes, 后缀表示为:B. -
KILOBYTES
Kilobytes, 后缀表示为:KB. -
MEGABYTES
Megabytes, 后缀表示为:MB. -
GIGABYTES
Gigabytes, 后缀表示为:GB. -
TERABYTES
Terabytes, 后缀表示为:TB.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
fromSuffix
通过后缀返回对应的 DataUnit- Parameters:
suffix- 单位后缀- Returns:
- 匹配到的
DataUnit - Throws:
IllegalArgumentException- 后缀无法识别报错
-