diff --git a/src/main/java/de/javakaffee/kryoserializers/EnumMapSerializer.java b/src/main/java/de/javakaffee/kryoserializers/EnumMapSerializer.java index d5410c22..94fd5d41 100644 --- a/src/main/java/de/javakaffee/kryoserializers/EnumMapSerializer.java +++ b/src/main/java/de/javakaffee/kryoserializers/EnumMapSerializer.java @@ -80,7 +80,7 @@ public class EnumMapSerializer extends Serializer, ?>> final EnumMap rawResult = result; final int size = input.readInt(true); for ( int i = 0; i < size; i++ ) { - final int ordinal = input.readInt(true); + final int ordinal = input.readVarInt(true); final Enum key = enumConstants[ordinal]; final Object value = kryo.readClassAndObject( input ); rawResult.put( key, value ); @@ -93,7 +93,7 @@ public void write(final Kryo kryo, final Output output, final EnumMap,?> entry : map.entrySet() ) { - output.writeInt(entry.getKey().ordinal(), true); + output.writeVarInt(entry.getKey().ordinal(), true); kryo.writeClassAndObject(output, entry.getValue()); } if ( TRACE ) trace( "kryo", "Wrote EnumMap: " + map );