public enum SizeUnit extends Enum<SizeUnit>
| Enum Constant and Description |
|---|
BYTES
Smallest memory unit.
|
GIGABYTES
"One billion" (1024x1024x1024) bytes.
|
KILOBYTES
"One thousand" (1024) bytes.
|
MEGABYTES
"One million" (1024x1024) bytes.
|
| Modifier and Type | Method and Description |
|---|---|
double |
toBytes(long input)
Returns the number of bytes corresponding to the provided input for a particular unit of memory.
|
double |
toGigaBytes(long input)
Returns the number of gigabytes corresponding to the provided input for a particular unit of memory.
|
double |
toKiloBytes(long input)
Returns the number of kilobytes corresponding to the provided input for a particular unit of memory.
|
double |
toMegaBytes(long input)
Returns the number of megabytes corresponding to the provided input for a particular unit of memory.
|
static SizeUnit |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SizeUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SizeUnit BYTES
public static final SizeUnit KILOBYTES
public static final SizeUnit MEGABYTES
public static final SizeUnit GIGABYTES
public static SizeUnit[] values()
for (SizeUnit c : SizeUnit.values()) System.out.println(c);
public static SizeUnit 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 double toBytes(long input)
input - Number of units of memory.public double toKiloBytes(long input)
input - Number of units of memory.public double toMegaBytes(long input)
input - Number of units of memory.public double toGigaBytes(long input)
input - Number of units of memory.Copyright © 2018. All rights reserved.