public static ulong ReadULong(ByteBuffer buffer, byte formatCode) { if (formatCode == FormatCode.ULong0) { return 0; } else if (formatCode == FormatCode.SmallULong) { return AmqpBitConverter.ReadUByte(buffer); } else if (formatCode == FormatCode.ULong) { return AmqpBitConverter.ReadULong(buffer); } else { throw InvalidFormatCodeException(formatCode, buffer.Offset); } }