Jroland/kafka-net — pull request #30 by Zoltu (2014-12-15 07:02:56+00:00)
Title: Buffer underrun exception tests

Note: Depends on PR #29.

This adds two tests of the buffer underrun behavior. One of them currently *FAILS* due to a bug in the implementation. The bug is that the total MessageSet size is being compared against the expected message length. The message set size includes already read parts of the payload such as the offset and the message size itself.

The quick fix would be to change `if (stream.Payload.Length < messageSize)` into `if (stream.Payload.Length - MessageHeaderSize < messageSize)`.