public enum MemoryUnit extends Enum<MemoryUnit>
| Enum Constant and Description |
|---|
BYTES
Represents bytes
|
GB
Represents gigabytes, 1 gigabyte = 1024 megabytes (
MB). |
KB
Represents kilobytes, 1 kilobyte = 1024 bytes (
BYTES). |
MB
Represents megabytes, 1 megabyte = 1024 kilobytes (
KB). |
| Modifier and Type | Method and Description |
|---|---|
static String |
mbString(long bytes) |
long |
toBytes(long amount) |
double |
toGB(long amount) |
double |
toKB(long amount) |
double |
toMB(long amount) |
static MemoryUnit |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static MemoryUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final MemoryUnit BYTES
public static final MemoryUnit KB
BYTES).public static final MemoryUnit MB
KB).public static final MemoryUnit GB
MB).public static MemoryUnit[] values()
for (MemoryUnit c : MemoryUnit.values()) System.out.println(c);
public static MemoryUnit 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 toBytes(long amount)
public double toKB(long amount)
public double toMB(long amount)
public double toGB(long amount)
public static String mbString(long bytes)
Copyright © 2017. All rights reserved.