public static < T extends Enum < T > > T readEnum ( final DataInput in , final Class < T > enumType ) throws IOException { if ( ! in . readBoolean ( ) ) { return null ; } return T . valueOf ( enumType , StringRecord . readString ( in ) ) ; }
Reads a value from the given enumeration from the specified input stream .