public void Write( DrdaStreamWriter writer) { writer.WriteUInt8(0x00); writer.WriteUInt32((UInt32)_sqlStatement.Length); writer.WriteBytes(Encoding.UTF8.GetBytes(_sqlStatement)); writer.WriteUInt8(0xFF); }
public static void WriteVarString( this DrdaStreamWriter writer, String value) { var bytes = Encoding.UTF8.GetBytes(value); writer.WriteUInt16((UInt16)bytes.Length); writer.WriteBytes(bytes); }
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); }
public void Write(DrdaStreamWriter writer) { writer.WriteUInt16((UInt16)GetSize()); writer.WriteUInt16((UInt16)CodePoint.MGRLVLLS); foreach (var value in Values) { writer.WriteUInt16(value); } }
public void Write( DrdaStreamWriter writer) { writer.WriteUInt16((UInt16)GetSize()); writer.WriteUInt8(0xD0); // DDMID writer.WriteUInt8((Byte)_format); writer.WriteUInt16(_requestCorrelationId); _command.Write(writer); }
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); } }
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); }
public void Write(DrdaStreamWriter writer) { throw new NotImplementedException(); }
public void Write(DrdaStreamWriter writer) { writer.WriteUInt16((UInt16)GetSize()); writer.WriteUInt16((UInt16)CodePoint); writer.WriteUInt16(Value); }
public void Write( DrdaStreamWriter writer) { writer.WriteUInt8((Byte)_type); writer.WriteUInt16(_length); }
public void Write( DrdaStreamWriter writer) => writer.WriteBytes(_bytes);
public void Write(DrdaStreamWriter writer) { writer.WriteUInt16((UInt16)GetSize()); writer.WriteUInt16((UInt16)CodePoint); writer.WriteBytes(Reader?.ReadBytes(_totalByteLength)); }