fix bug: last enum index throws DecodingSchemaMismatchException

fix bug: when enum index being written is the last index defined in theEnum, a DecodingSchemaMismatchException was thrown. maintain enum loopup table in EnumType