Amqp.Types.Encoder.ReadULong C# (CSharp) Method

ReadULong() public static method

Reads an unsigned 64-bit integer from a buffer.
public static ReadULong ( System.ByteBuffer buffer, byte formatCode ) : ulong
buffer System.ByteBuffer The buffer to read.
formatCode byte The format code of the value.
return ulong
        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);
            }
        }