Use EnumMap instead of HashMap in binary serializers