Fix partial reads on compressed data #27
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "partialread"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi, thanks for the library! I found this issue via inspection, in practice it is probably less likely when reading a FileStream due to buffering:
When reading a compressed data element, the call to
reader.BaseStream.Read
may read fewer bytes than expected. Usingreader.ReadBytes
instead will get the correct number of bytes (unless EOF is reached, in which case the file is probably corrupt anyway).For testing, use a wrapping stream which only reads one byte at a time. I just applied this on all the reader tests
Great! Thanks for your work!
Thanks!