Esempio n. 1
0
        void roundtrip(ulong x)
        {
            // Use some padding bytes to check nonzero offsets.
            var pad = 5;

            var buf = new byte[VarInt.MaxVarIntLen64 + pad];
            int n   = VarInt.PutUvarInt(buf, pad, x);

            var ret = VarInt.UvarInt(buf, pad);

            Assert.AreEqual(n, ret.VarIntLength);
            Assert.AreEqual(x, ret.Value);
        }