public static void EncodeVariable(this MemoryCursor cursor, ulong value) { var bytes = cursor.PeekEnd(); VariableLengthEncoding.Encode(bytes.Span, value, out var encodedLength); cursor.Move(encodedLength); }
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); }