public enum ByteSizeUnit extends java.lang.Enum<ByteSizeUnit> implements Writeable
Writeable.Reader<V>, Writeable.Writer<V>
Modifier and Type | Method and Description |
---|---|
static ByteSizeUnit |
fromId(int id) |
static ByteSizeUnit |
readFrom(StreamInput in)
Reads a
ByteSizeUnit from a given StreamInput |
abstract long |
toBytes(long size) |
abstract long |
toGB(long size) |
abstract long |
toKB(long size) |
abstract long |
toMB(long size) |
abstract long |
toPB(long size) |
abstract long |
toTB(long size) |
static ByteSizeUnit |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ByteSizeUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
void |
writeTo(StreamOutput out)
Write this into the StreamOutput.
|
public static final ByteSizeUnit BYTES
public static final ByteSizeUnit KB
public static final ByteSizeUnit MB
public static final ByteSizeUnit GB
public static final ByteSizeUnit TB
public static final ByteSizeUnit PB
public static ByteSizeUnit[] values()
for (ByteSizeUnit c : ByteSizeUnit.values()) System.out.println(c);
public static ByteSizeUnit 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 nullpublic static ByteSizeUnit fromId(int id)
public abstract long toBytes(long size)
public abstract long toKB(long size)
public abstract long toMB(long size)
public abstract long toGB(long size)
public abstract long toTB(long size)
public abstract long toPB(long size)
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
public static ByteSizeUnit readFrom(StreamInput in) throws java.io.IOException
ByteSizeUnit
from a given StreamInput
java.io.IOException