Ejemplo n.º 1
0
        public void Visit(object level, VisitArgs args)
        {
            if (args.Index > 0)
            {
                BinaryZPacker.Pack(_writeBuffer, args.Index);
            }

            if (level == null)
            {
                _writeBuffer.WriteByte(BinaryZPacker.Null);
                return;
            }

            _writeBuffer.WriteByte(BinaryZPacker.VariabelLength);

            if (args.IsRoot)
            {
                return;
            }
            _reservations.Push(_writer.Reserve());
        }