@classmethod<EOL><INDENT>def _decode_message_set_iter(cls, data):<DEDENT>
cur = <NUM_LIT:0><EOL>read_message = False<EOL>while cur < len(data):<EOL><INDENT>try:<EOL><INDENT>((offset, ), cur) = relative_unpack('<STR_LIT>', data, cur)<EOL>(msg, cur) = read_int_string(data, cur)<EOL>for (offset, message) in KafkaProtocol._decode_message(msg, offset):<EOL><INDENT>read_message = True<EOL>yield OffsetAndMessage(offset, message)<EOL><DEDENT><DEDENT>except BufferUnderflowError:<EOL><INDENT>if read_message is False:<EOL><INDENT>raise ConsumerFetchSizeTooSmall()<EOL><DEDENT>else:<EOL><INDENT>raise StopIteration()<EOL><DEDENT><DEDENT><DEDENT>
Iteratively decode a MessageSet

Reads repeated elements of (offset, message), calling decode_message
to decode a single message. Since compressed messages contain futher
MessageSets, these two methods have been decoupled so that they may
recurse easily.