code: def add_stream(self, stream, path, compress, flags):
          
          self.data_fileobj.seek(self.last_offset)
  
          if compress == 'bz2':
              stream = bz2_compress_stream(stream)
          elif compress == 'xz':
              stream = xz_compress_stream(stream)
          elif compress is None:
              pass
          else:
              raise ValueError('Unsupported compression type: {}'.format(compress))
  
          size = write_to_file(stream, self.data_fileobj)
  
          # On Windows, convert \ to /
          # very difficult to mock this out for coverage on linux
          if os.sep == '\\':  # pragma: no cover
              path = path.replace('\\', '/')
  
          e = dict(
              name=six.u(path),
              offset=self.last_offset,
              size=size,
              flags=flags,
          )
          self.entries.append(e)
          self.last_offset += e['size']
docs: 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