Core/CafeLib.Core.Buffers/ByteSequenceReader.cs
/// <summary>
/// Reads an <see cref="UInt64"/> as in bitcoin Variant format.
/// </summary>
/// <returns>False if there wasn't enough data for an <see cref="UInt64"/>.</returns>
Reads an  as in bitcoin Variant format.
Reads an as in bitcoin Variant format .
public bool TryReadVariant(out long value)
        {
            value = 0L;
            var b = Data.TryRead(out var b0);
            if (!b) return false;
            if (b0 <= 0xfc)
            {
                value = b0;
            }
            else if (b0 == 0xfd)
            {
                b = Data.TryReadLittleEndian(out short v16);
                value = v16;
            }
            else if (b0 == 0xfe)
            {
                b = Data.TryReadLittleEndian(out int v32);
                value = v32;
            }
            else
            {
                b = Data.TryReadLittleEndian(out value);
            }
            return b;
        }
public bool TryReadVariant ( out long value ) { value = 0L ; var b = Data . TryRead ( out var b0 ) ; if ( ! b ) return false ; if ( b0 <= 0xfc ) { value = b0 ; } else if ( b0 == 0xfd ) { b = Data . TryReadLittleEndian ( out short v16 ) ; value = v16 ; } else if ( b0 == 0xfe ) { b = Data . TryReadLittleEndian ( out int v32 ) ; value = v32 ; } else { b = Data . TryReadLittleEndian ( out value ) ; } return b ; }
Reads an  as in bitcoin Variant format.
Reads an as in bitcoin Variant format .
False if there wasn't enough data for an .
False if there wasn ' t enough data for an .
long
out