I receive compressed binary data and i am trying to decompress it but get the error 'Error inflating: invalid stored block lengths' on the line 'bytesread = C1StreamReader.Read(DeCompressByte, 0, DeCompressByte.Length)'
I am using vb.net and if i use Response.BinaryWrite(binaryData), it opens fine as a zip but i only want the pdf within the zip
Can anyone see what I'm doing wrong. I am new to this so it could be something very simple.
Dim MemStream As New MemoryStream(binaryData)
Dim C1StreamReader As New C1.C1Zip.C1ZStreamReader(MemStream, True)
Dim MemStreamOut As New MemoryStream()
Dim DeCompressByte(binaryData.Length) As Byte
Dim bytesread As Integer
bytesread = C1StreamReader.Read(DeCompressByte, 0, DeCompressByte.Length)
While bytesread <> 0
bytesread = C1StreamReader.Read (DeCompressByte, 0, DeCompressByte.Length)
MemStreamOut.Write(DeCompressByte, 0, bytesread)
End While
MemStreamOut.ToArray()