Пример #1
0
        public void Read(Stream stream, DbEnvironment env, IFormatToken previousFormatToken)
        {
            var remainingLength = Type == TokenType.TDS_PARAMFMT
                ? stream.ReadUShort()
                : stream.ReadUInt();

            using (var ts = new ReadablePartialStream(stream, remainingLength))
            {
                var paramCount = ts.ReadUShort();
                var formats    = new List <FormatItem>();

                for (var i = 0; i < paramCount; i++)
                {
                    formats.Add(FormatItem.ReadForParameter(ts, env.Encoding, Type));
                }

                Formats = formats.ToArray();
            }
        }