public static long ReadLong(ByteBuffer buffer, byte formatCode) { if (formatCode == FormatCode.SmallLong) { return AmqpBitConverter.ReadByte(buffer); } else if (formatCode == FormatCode.Long) { return AmqpBitConverter.ReadLong(buffer); } else { throw InvalidFormatCodeException(formatCode, buffer.Offset); } }