code: def write_header(self):
          
          self.fileobj.seek(0)
          header = mar_header.build(dict(index_offset=self.last_offset))
          self.fileobj.write(header)
docs: Write the MAR header to the file.
  
          The MAR header includes the MAR magic bytes as well as the offset to
          where the index data can be found.