コード例 #1
0
 public void Write(
     DrdaStreamWriter writer)
 {
     writer.WriteUInt8(0x00);
     writer.WriteUInt32((UInt32)_sqlStatement.Length);
     writer.WriteBytes(Encoding.UTF8.GetBytes(_sqlStatement));
     writer.WriteUInt8(0xFF);
 }
コード例 #2
0
        public static void WriteVarString(
            this DrdaStreamWriter writer,
            String value)
        {
            var bytes = Encoding.UTF8.GetBytes(value);

            writer.WriteUInt16((UInt16)bytes.Length);
            writer.WriteBytes(bytes);
        }
コード例 #3
0
        public static void WriteString(
            this DrdaStreamWriter writer,
            String value,
            Int32 maxLength)
        {
            value = value?.Substring(0, maxLength) ?? String.Empty;
            var bytes = Encoding.UTF8.GetBytes(value);

            writer.WriteBytes(bytes);
        }
コード例 #4
0
            public void Write(DrdaStreamWriter writer)
            {
                writer.WriteUInt16((UInt16)GetSize());
                writer.WriteUInt16((UInt16)CodePoint.MGRLVLLS);

                foreach (var value in Values)
                {
                    writer.WriteUInt16(value);
                }
            }
コード例 #5
0
        public void Write(
            DrdaStreamWriter writer)
        {
            writer.WriteUInt16((UInt16)GetSize());
            writer.WriteUInt8(0xD0); // DDMID
            writer.WriteUInt8((Byte)_format);
            writer.WriteUInt16(_requestCorrelationId);

            _command.Write(writer);
        }
コード例 #6
0
ファイル: CompositeCommand.cs プロジェクト: splicemachine/NET
        public void Write(
            DrdaStreamWriter writer)
        {
            var size = GetSize();

            if (size > MaxSize)
            {
                writer.WriteUInt16(SegmentFlag);
                writer.WriteUInt16((UInt16)CodePoint);
                writer.WriteUInt32(size);
            }
            else
            {
                writer.WriteUInt16((UInt16)size);
                writer.WriteUInt16((UInt16)CodePoint);
            }

            foreach (var parameter in _parameters)
            {
                parameter.Write(writer);
            }
        }
コード例 #7
0
        public static void WriteDecimal(
            this DrdaStreamWriter writer,
            Decimal value,
            Int32 precision,
            Int32 scale)
        {
            var bytes = new Byte[precision / 2 + 1];

            value *= Scales[scale];

            var nybble = value < 0 ? 0x0d : 0x0c;

            value = Decimal.Floor(Decimal.Negate(value));

            var i = bytes.Length - 1;

            if (precision % 2 == 1)
            {
                nybble |= (Int32)(value % 10) << 4;
                value  /= 10;
            }
            bytes[i] = (Byte)(nybble & 0xFF);

            for (--i; i >= 0; --i)
            {
                nybble = (Int32)(value % 10);
                value /= 10;

                nybble |= (Int32)(value % 10) << 4;
                value  /= 10;

                bytes[i] = (Byte)(nybble & 0xFF);
            }

            writer.WriteBytes(bytes);
        }
コード例 #8
0
 public void Write(DrdaStreamWriter writer)
 {
     throw new NotImplementedException();
 }
コード例 #9
0
 public void Write(DrdaStreamWriter writer)
 {
     writer.WriteUInt16((UInt16)GetSize());
     writer.WriteUInt16((UInt16)CodePoint);
     writer.WriteUInt16(Value);
 }
コード例 #10
0
 public void Write(
     DrdaStreamWriter writer)
 {
     writer.WriteUInt8((Byte)_type);
     writer.WriteUInt16(_length);
 }
コード例 #11
0
 public void Write(
     DrdaStreamWriter writer) =>
 writer.WriteBytes(_bytes);
コード例 #12
0
 public void Write(DrdaStreamWriter writer)
 {
     writer.WriteUInt16((UInt16)GetSize());
     writer.WriteUInt16((UInt16)CodePoint);
     writer.WriteBytes(Reader?.ReadBytes(_totalByteLength));
 }