def add_stream(self, stream, path, compress, flags):
self.data_fileobj.seek(self.last_offset)<EOL>if compress == '<STR_LIT>':<EOL><INDENT>stream = bz2_compress_stream(stream)<EOL><DEDENT>elif compress == '<STR_LIT>':<EOL><INDENT>stream = xz_compress_stream(stream)<EOL><DEDENT>elif compress is None:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>'.format(compress))<EOL><DEDENT>size = write_to_file(stream, self.data_fileobj)<EOL>if os.sep == '<STR_LIT:\\>':  <EOL><INDENT>path = path.replace('<STR_LIT:\\>', '<STR_LIT:/>')<EOL><DEDENT>e = dict(<EOL>name=six.u(path),<EOL>offset=self.last_offset,<EOL>size=size,<EOL>flags=flags,<EOL>)<EOL>self.entries.append(e)<EOL>self.last_offset += e['<STR_LIT:size>']<EOL>
Add the contents of an iterable to the MAR file.

        Args:
            stream (iterable): yields blocks of data
            path (str): name of this file in the MAR file
            compress (str): One of 'xz', 'bz2', or None. Defaults to None.
            flags (int): permission of this file in the MAR file