Ejemplo n.º 1
0
        public void Convert(String value, BinaryWriteBuffer writeBuffer)
        {
            var length = Encoding.GetByteCount(value);
            var offset = writeBuffer.Advance(length);

            Convert(value, writeBuffer.Buffer, offset);
        }
Ejemplo n.º 2
0
        public void VisitValue(short?value, VisitArgs args)
        {
            if (args.Index > 0)
            {
                BinaryZPacker.Pack(_writeBuffer, args.Index);
            }

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

            var length = BinaryPV64Packer.GetSLength(value.Value);

            _writeBuffer.WriteByte(length);
            var offset = _writeBuffer.Advance(length);

            BinaryPV64Packer.PackS(_writeBuffer.Buffer, offset, value.Value, length);
        }
Ejemplo n.º 3
0
        public void Convert(UInt64 value, BinaryWriteBuffer writeBuffer)
        {
            var offset = writeBuffer.Advance(8);

            Convert(value, writeBuffer.Buffer, offset);
        }
Ejemplo n.º 4
0
        public void Convert(SByte value, BinaryWriteBuffer writeBuffer)
        {
            var offset = writeBuffer.Advance(1);

            Convert(value, writeBuffer.Buffer, offset);
        }
Ejemplo n.º 5
0
        public void Convert(Decimal value, BinaryWriteBuffer writeBuffer)
        {
            var offset = writeBuffer.Advance(16);

            Convert(value, writeBuffer.Buffer, offset);
        }