Map readEnum and writeEnum