code: public static void writeTo(Output output, int number, boolean repeated, Enum<?> e) 
      throws IOException
      {
          if(ENUMS_BY_NAME)
              output.writeString(number, e.name(), repeated);
          else
              output.writeEnum(number, e.ordinal(), repeated);
      }
docs: Writes the {@link Enum} to the output.