public enum DataSizeUnit extends Enum<DataSizeUnit>
Enum Constant and Description |
---|
BYTES
Bytes (8 bits).
|
GIBIBYTES
Gibibytes (1024 mebibytes).
|
GIGABYTES
Gigabytes (1000 megabytes).
|
KIBIBYTES
Kibibytes (1024 bytes).
|
KILOBYTES
Kilobytes (1000 bytes).
|
MEBIBYTES
Mebibytes (1024 kibibytes).
|
MEGABYTES
Megabytes (1000 kilobytes).
|
PEBIBYTES
Pebibytes (1024 tebibytes).
|
PETABYTES
Petabytes (1000 terabytes).
|
TEBIBYTES
Tebibytes (1024 gibibytes).
|
TERABYTES
Terabytes (1000 gigabytes).
|
Modifier and Type | Method and Description |
---|---|
long |
convert(long size,
DataSizeUnit unit)
Converts a size of the given unit into the current unit.
|
long |
toBytes(long l)
Converts the given number of the current units into bytes.
|
long |
toGibibytes(long l)
Converts the given number of the current units into gibibytes.
|
long |
toGigabytes(long l)
Converts the given number of the current units into gigabytes.
|
long |
toKibibytes(long l)
Converts the given number of the current units into kibibytes.
|
long |
toKilobytes(long l)
Converts the given number of the current units into kilobytes.
|
long |
toMebibytes(long l)
Converts the given number of the current units into mebibytes.
|
long |
toMegabytes(long l)
Converts the given number of the current units into megabytes.
|
long |
toPebibytes(long l)
Converts the given number of the current units into pebibytes.
|
long |
toPetabytes(long l)
Converts the given number of the current units into petabytes.
|
long |
toTebibytes(long l)
Converts the given number of the current units into tebibytes.
|
long |
toTerabytes(long l)
Converts the given number of the current units into terabytes.
|
static DataSizeUnit |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DataSizeUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DataSizeUnit BYTES
public static final DataSizeUnit KILOBYTES
public static final DataSizeUnit MEGABYTES
public static final DataSizeUnit GIGABYTES
public static final DataSizeUnit TERABYTES
public static final DataSizeUnit PETABYTES
public static final DataSizeUnit KIBIBYTES
public static final DataSizeUnit MEBIBYTES
public static final DataSizeUnit GIBIBYTES
public static final DataSizeUnit TEBIBYTES
public static final DataSizeUnit PEBIBYTES
public static DataSizeUnit[] values()
for (DataSizeUnit c : DataSizeUnit.values()) System.out.println(c);
public static DataSizeUnit valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic long convert(long size, DataSizeUnit unit)
size
- the magnitude of the sizeunit
- the unit of the sizepublic long toBytes(long l)
l
- the magnitude of the size in the current unitl
of the current units in bytespublic long toKilobytes(long l)
l
- the magnitude of the size in the current unitl
of the current units in kilobytespublic long toMegabytes(long l)
l
- the magnitude of the size in the current unitl
of the current units in megabytespublic long toGigabytes(long l)
l
- the magnitude of the size in the current unitl
of the current units in gigabytespublic long toTerabytes(long l)
l
- the magnitude of the size in the current unitl
of the current units in terabytespublic long toPetabytes(long l)
l
- the magnitude of the size in the current unitl
of the current units in petabytespublic long toKibibytes(long l)
l
- the magnitude of the size in the current unitl
of the current units in kibibytespublic long toMebibytes(long l)
l
- the magnitude of the size in the current unitl
of the current units in mebibytespublic long toGibibytes(long l)
l
- the magnitude of the size in the current unitl
of the current units in gibibytespublic long toTebibytes(long l)
l
- the magnitude of the size in the current unitl
of the current units in tebibytespublic long toPebibytes(long l)
l
- the magnitude of the size in the current unitl
of the current units in pebibytesCopyright © 2020. All rights reserved.