def addfile(self, tarinfo, fileobj=None):
self._check("<STR_LIT>")<EOL>tarinfo = copy.copy(tarinfo)<EOL>buf = tarinfo.tobuf(self.format, self.encoding, self.errors)<EOL>self.fileobj.write(buf)<EOL>self.offset += len(buf)<EOL>if fileobj is not None:<EOL><INDENT>copyfileobj(fileobj, self.fileobj, tarinfo.size)<EOL>blocks, remainder = divmod(tarinfo.size, BLOCKSIZE)<EOL>if remainder > <NUM_LIT:0>:<EOL><INDENT>self.fileobj.write(NUL * (BLOCKSIZE - remainder))<EOL>blocks += <NUM_LIT:1><EOL><DEDENT>self.offset += blocks * BLOCKSIZE<EOL><DEDENT>self.members.append(tarinfo)<EOL>
Add the TarInfo object `tarinfo' to the archive. If `fileobj' is
           given, tarinfo.size bytes are read from it and added to the archive.
           You can create TarInfo objects using gettarinfo().
           On Windows platforms, `fileobj' should always be opened with mode
           'rb' to avoid irritation about the file size.