Ejemplo n.º 1
0
        public static void EncodeVariable(this MemoryCursor cursor, ulong value)
        {
            var bytes = cursor.PeekEnd();

            VariableLengthEncoding.Encode(bytes.Span, value, out var encodedLength);

            cursor.Move(encodedLength);
        }
Ejemplo n.º 2
0
        public static ulong DecodeVariable(this MemoryCursor cursor)
        {
            var bytes = cursor.PeekEnd();
            var value = VariableLengthEncoding.Decode(bytes.Span, out var encodedLength);

            cursor.Move(encodedLength);

            return(value);
        }