public final class EnumUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T extends Enum<T>> |
readEnum(DataInput in,
Class<T> enumType)
Reads a value from the given enumeration from the specified input stream.
|
static void |
writeEnum(DataOutput out,
Enum<?> enumVal)
Writes a value of an enumeration to the given output stream.
|
public static <T extends Enum<T>> T readEnum(DataInput in, Class<T> enumType) throws IOException
T - the type of the enumerationin - the input stream to read fromenumType - the class of the enumerationIOException - thrown if any error occurred while reading data from the streampublic static void writeEnum(DataOutput out, Enum<?> enumVal) throws IOException
out - the output stream to write toenumVal - the value of a enumeration to be written to the output streamIOException - thrown if any error occurred while writing data to the streamCopyright © 2015 The Apache Software Foundation. All rights reserved.