Good day.
I want to get xml data from tp_field of AllList table in database.
I've all ready read data from this column and i want to decompress it.
Here is a code
SqlBytes bytes = reader.GetSqlBytes(i);
Stream
stream = bytes.Stream;
for (int
i = 0; i < 14; i++)
stream.ReadByte();
System.IO.Compression.
DeflateStream deflateStream = new System.IO.Compression.DeflateStream(stream, System.IO.Compression.CompressionMode.Decompress,true
);
StreamReader sr = newStreamReader
(deflateStream);
string fields = sr.ReadToEnd();
On some lists(not all) this code not working throwing on sr.ReadToEnd() exception
System.IO.InvalidDataException: Unknown block type. Stream might be corrupted.at System.IO.Compression.Inflater.Decode() at System.IO.Compression.Inflater.Inflate(Byte[] bytes, Int32 offset, Int32 length) at System.IO.Compression.DeflateStream.Read(Byte[] array, Int32 offset, Int32 count) at System.IO.StreamReader.ReadBuffer() at System.IO.StreamReader.ReadToEnd()
How can i fix it?
Best regards,
Chernobrivec.