diff --git a/protocol/src/main/java/com/zfoo/protocol/buffer/ByteBufUtils.java b/protocol/src/main/java/com/zfoo/protocol/buffer/ByteBufUtils.java index f65bd55c..eccc9818 100644 --- a/protocol/src/main/java/com/zfoo/protocol/buffer/ByteBufUtils.java +++ b/protocol/src/main/java/com/zfoo/protocol/buffer/ByteBufUtils.java @@ -451,9 +451,9 @@ public abstract class ByteBufUtils { public static Map readIntIntMap(ByteBuf byteBuf) { var length = readInt(byteBuf); - var map = new IntObjectHashMap(CollectionUtils.comfortableCapacity(length)); + var map = new HashMapIntInt(CollectionUtils.comfortableCapacity(length)); for (var i = 0; i < length; i++) { - map.put(readInt(byteBuf), readIntBox(byteBuf)); + map.putPrimitive(readInt(byteBuf), readInt(byteBuf)); } return map; } @@ -472,9 +472,9 @@ public abstract class ByteBufUtils { public static Map readIntLongMap(ByteBuf byteBuf) { var length = readInt(byteBuf); - var map = new IntObjectHashMap(CollectionUtils.comfortableCapacity(length)); + var map = new HashMapIntLong(CollectionUtils.comfortableCapacity(length)); for (var i = 0; i < length; i++) { - map.put(readInt(byteBuf), readLongBox(byteBuf)); + map.putPrimitive(readInt(byteBuf), readLong(byteBuf)); } return map; } @@ -535,9 +535,9 @@ public abstract class ByteBufUtils { public static Map readLongIntMap(ByteBuf byteBuf) { var length = readInt(byteBuf); - var map = new LongObjectHashMap(CollectionUtils.comfortableCapacity(length)); + var map = new HashMapLongInt(CollectionUtils.comfortableCapacity(length)); for (var i = 0; i < length; i++) { - map.put(readLong(byteBuf), readIntBox(byteBuf)); + map.putPrimitive(readLong(byteBuf), readInt(byteBuf)); } return map; } @@ -556,9 +556,9 @@ public abstract class ByteBufUtils { public static Map readLongLongMap(ByteBuf byteBuf) { var length = readInt(byteBuf); - var map = new LongObjectHashMap(CollectionUtils.comfortableCapacity(length)); + var map = new HashMapLongLong(CollectionUtils.comfortableCapacity(length)); for (var i = 0; i < length; i++) { - map.put(readLong(byteBuf), readLongBox(byteBuf)); + map.putPrimitive(readLong(byteBuf), readLong(byteBuf)); } return map; }