def get_message_iterator()

in transcoder/source/file/LengthDelimitedFileMessageSource.py [0:0]


    def get_message_iterator(self):
        # pylint: disable=duplicate-code
        while True:

            # Read the message length
            msg_len_bytes = self.file_handle.read(self.prefix_length) #self.message_length_byte_length) #self.message_length_byte_length) #self.message_length_byte_length)

            if not msg_len_bytes:
                break

            message_length = int.from_bytes(msg_len_bytes, self.endian)
            self.increment_count()

            # Get the message
            msg_bytes = self.file_handle.read(message_length)
            if not msg_bytes:
                break

            if self.message_skip_bytes > 0:
                # Skip bytes based on the message_skip_bytes value
                skipped_bytes = self.file_handle.read(self.message_skip_bytes)
                if not skipped_bytes:
                    break
                yield msg_bytes[self.message_skip_bytes:]
            else:
                yield msg_bytes

            self._log_percentage_read()