| Enum Constant and Description |
|---|
Base10
Memory sizes are based on 10, i.e. a kilobyte is 1000 (10^3) bytes.
|
Base2
Memory sizes are based on 2, i.e. a kilobyte is 1024 (2^10) bytes.
|
| Modifier and Type | Field and Description |
|---|---|
java.math.BigInteger |
bigKiloSize
Size of one kilobyte when using this base, as BigInteger.
|
int |
kiloSize
Size of one kilobyte when using this base.
|
Indexable<java.lang.String> |
prefixes
List of prefixes when using this base.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
toString(java.math.BigInteger memSize)
Get a human-readable string representation of a memory size.
|
java.lang.String |
toString(java.math.BigInteger memSize,
java.lang.String sep,
java.lang.String suf)
Get a human-readable string representation of a memory size.
|
java.lang.String |
toString(long memSize)
Get a human-readable string representation of a memory size.
|
java.lang.String |
toString(long memSize,
java.lang.String sep,
java.lang.String suf)
Get a human-readable string representation of a memory size.
|
static MemFormat |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static MemFormat[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final MemFormat Base10
public static final MemFormat Base2
public final int kiloSize
public final java.math.BigInteger bigKiloSize
public static MemFormat[] values()
for (MemFormat c : MemFormat.values()) System.out.println(c);
public static MemFormat valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is null@NotNull public java.lang.String toString(long memSize)
memSize - memory size@NotNull public java.lang.String toString(@NotNull java.math.BigInteger memSize)
memSize - memory size@NotNull public java.lang.String toString(long memSize, @Nullable java.lang.String sep, @Nullable java.lang.String suf)
memSize - memory sizesep - separator between number and memory prefix, none if null
or emptysuf - additional suffix, e.g. "Byte", none if null
or empty"B" as suffix@NotNull public java.lang.String toString(@NotNull java.math.BigInteger memSize, @Nullable java.lang.String sep, @Nullable java.lang.String suf)
memSize - memory sizesep - separator between number and memory prefix, none if null
or emptysuf - additional suffix, e.g. "Bytes", none if null
or empty"B" as suffix