ToChars() static public method

static public ToChars ( System.DateTime value, byte chars, int offset ) : int
value System.DateTime
chars byte
offset int
return int
Example #1
0
        public override void WriteDateTimeText(DateTime value)
        {
            int offset;

            byte[] buffer = GetBuffer(XmlConverter.MaxDateTimeChars, out offset);
            Advance(XmlConverter.ToChars(value, buffer, offset));
        }
Example #2
0
        public override void WriteInt64Text(long value)
        {
            int offset;

            byte[] buffer = GetBuffer(XmlConverter.MaxInt64Chars, out offset);
            Advance(XmlConverter.ToChars(value, buffer, offset));
        }
Example #3
0
        public override void WriteFloatText(float value)
        {
            int offset;

            byte[] buffer = GetBuffer(XmlConverter.MaxFloatChars, out offset);
            Advance(XmlConverter.ToChars(value, buffer, offset));
        }
Example #4
0
        public override void WriteDecimalText(decimal value)
        {
            int offset;

            byte[] buffer = GetBuffer(XmlConverter.MaxDecimalChars, out offset);
            Advance(XmlConverter.ToChars(value, buffer, offset));
        }
Example #5
0
        public override void WriteDateTimeText(DateTime value)
        {
            int count = XmlConverter.ToChars(value, _chars, 0);

            if (_text)
            {
                _writer.WriteText(_chars, 0, count);
            }
            else
            {
                _writer.WriteDateTimeText(value);
            }
            _signingWriter.WriteText(_chars, 0, count);
        }
Example #6
0
 private int GetChars(int offset, int length, char[] chars, int charOffset)
 {
     byte[] buffer = _buffer;
     for (int i = 0; i < length; i++)
     {
         byte b = buffer[offset + i];
         if (b >= 0x80)
         {
             return(i + XmlConverter.ToChars(buffer, offset + i, length - i, chars, charOffset + i));
         }
         chars[charOffset + i] = (char)b;
     }
     return(length);
 }
        public override void WriteBoolText(bool value)
        {
            int count = XmlConverter.ToChars(value, this.chars, 0);

            if (this.text)
            {
                this.writer.WriteText(this.chars, 0, count);
            }
            else
            {
                this.writer.WriteBoolText(value);
            }
            this.signingWriter.WriteText(this.chars, 0, count);
        }
        public override void WriteDecimalText(decimal value)
        {
            int count = XmlConverter.ToChars(value, chars, 0);

            if (text)
            {
                writer.WriteText(chars, 0, count);
            }
            else
            {
                writer.WriteDecimalText(value);
            }
            signingWriter.WriteText(chars, 0, count);
        }
 private int GetChars(int offset, int length, char[] chars)
 {
     byte[] buffer = this.buffer;
     for (int i = 0; i < length; i++)
     {
         byte num2 = buffer[offset + i];
         if (num2 >= 0x80)
         {
             return(i + XmlConverter.ToChars(buffer, offset + i, length - i, chars, i));
         }
         chars[i] = (char)num2;
     }
     return(length);
 }