diff --git a/src/main/java/com/rabbitmq/client/impl/ValueReader.java b/src/main/java/com/rabbitmq/client/impl/ValueReader.java index 3e80f8853e..7c708f73d2 100644 --- a/src/main/java/com/rabbitmq/client/impl/ValueReader.java +++ b/src/main/java/com/rabbitmq/client/impl/ValueReader.java @@ -164,6 +164,9 @@ static Object readFieldValue(DataInputStream in) case 'I': value = in.readInt(); break; + case 'i': + value = readUnsignedInt(in); + break; case 'D': int scale = in.readUnsignedByte(); byte [] unscaled = new byte[4]; @@ -213,6 +216,19 @@ static Object readFieldValue(DataInputStream in) return value; } + /** Read an unsigned int */ + private static long readUnsignedInt(DataInputStream in) + throws IOException + { + long ch1 = in.read(); + long ch2 = in.read(); + long ch3 = in.read(); + long ch4 = in.read(); + if ((ch1 | ch2 | ch3 | ch4) < 0) + throw new EOFException(); + return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8) + ch4); + } + /** Read a field-array */ private static List readArray(DataInputStream in) throws IOException