code: public static <T extends Enum<T>> T readEnum(DataInput in, Class<T> enumType) throws IOException {
          return T.valueOf(enumType, Text.readString(in));
      }
docs: Read an Enum value from DataInput, Enums are read and written
  using String values.
  @param <T> Enum type
  @param in DataInput to read from
  @param enumType Class type of Enum
  @return Enum represented by String read from DataInput
  @throws IOException