DataSize units.
The unit prefixes used in this class are binary prefixes indicating multiplication by powers of 2. The following table displays the enum constants defined in this class and corresponding values.
| Constant | Data Size | Power of 2 | Size in Bytes |
|---|---|---|---|
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 |
DataSize
| Modifier and Type | Field and Description |
|---|---|
| public static final DataUnit | BYTES
Bytes, represented by suffix |
| public static final DataUnit | GIGABYTES
Gigabytes, represented by suffix |
| public static final DataUnit | KILOBYTES
Kilobytes, represented by suffix |
| public static final DataUnit | MEGABYTES
Megabytes, represented by suffix |
| private final DataSize | |
| private final String | |
| public static final DataUnit | TERABYTES
Terabytes, represented by suffix |
| Modifier and Type | Method and Description |
|---|---|
| public static DataUnit | fromSuffix(String
one of the standard suffixes suffix)Return the |
| pack-priv DataSize | |
| public static DataUnit | |
| public static DataUnit[] |
| BYTES | back to summary |
|---|---|
| public static final DataUnit BYTES Bytes, represented by suffix | |
| GIGABYTES | back to summary |
|---|---|
| public static final DataUnit GIGABYTES Gigabytes, represented by suffix | |
| KILOBYTES | back to summary |
|---|---|
| public static final DataUnit KILOBYTES Kilobytes, represented by suffix | |
| MEGABYTES | back to summary |
|---|---|
| public static final DataUnit MEGABYTES Megabytes, represented by suffix | |
| size | back to summary |
|---|---|
| private final DataSize size | |
| suffix | back to summary |
|---|---|
| private final String suffix | |
| TERABYTES | back to summary |
|---|---|
| public static final DataUnit TERABYTES Terabytes, represented by suffix | |
| DataUnit | back to summary |
|---|---|
| private DataUnit(String suffix, DataSize size) | |
| fromSuffix | back to summary |
|---|---|
| public static DataUnit fromSuffix(String suffix) Return the
| |
| size | back to summary |
|---|---|
| pack-priv DataSize size() | |
| valueOf | back to summary |
|---|---|
| public static DataUnit valueOf(String name) | |
| values | back to summary |
|---|---|
| public static DataUnit[] values() | |