Jroland/kafka-net — pull request #32 by Zoltu (2014-12-15 18:26:11+00:00)
Title: Adds two tests of the buffer underrun exception.

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)`.