Example #1
0
        // Fills the given byte buffer from start position, and returns length
        public static int LongToBytes(long value, byte[] buffer, int start = 0)
        {
            var zz = encodeZigZag(value, 64);

            return(UVarInt.ULongToBytes((ulong)zz, buffer, start));
        }
Example #2
0
        public static long BytesToLong(byte[] data, ref int position)
        {
            var zz = UVarInt.BytesToULong(data, ref position);

            return(decodeZigZag(zz));
        }