public static int ReadInt(ByteBuffer buffer, byte formatCode) { if (formatCode == FormatCode.SmallInt) { return AmqpBitConverter.ReadByte(buffer); } else if (formatCode == FormatCode.Int) { return AmqpBitConverter.ReadInt(buffer); } else { throw InvalidFormatCodeException(formatCode, buffer.Offset); } }