mreiferson/go-snappystream — pull request #13 by bmatsuo (2014-08-18 06:18:37+00:00)
Title: reader: rewrite nextFrame to fix various bugs.

Fixes #5 along with other bugs related to chunk size and handling of
EOF.

- compressed blocks may have length up to
snappy.MaxEncodedLen(MaxBlockSize), the longest block which could
successfully decode to MaxBlockSize or fewer bytes. blocks are
checked to have decoded length at most MaxBlockSize before being
decoded.

- successfully decodes padding and skippable chunks with size up to
2^24-1, the maximum representable chunk size.

- fixes error reporting for reserved unskippable blocks with length
greater than MaxBlockSize up to 2^24 -1. instead of being reported
as too long they are reported as unskippable blocks.

- simplify reader tests.

- fix occurrences of the reader returning EOF after partial decoding.