def _proc_sparse(self, tarfile):
<EOL>structs, isextended, origsize = self._sparse_structs<EOL>del self._sparse_structs<EOL>while isextended:<EOL><INDENT>buf = tarfile.fileobj.read(BLOCKSIZE)<EOL>pos = <NUM_LIT:0><EOL>for i in range(<NUM_LIT>):<EOL><INDENT>try:<EOL><INDENT>offset = nti(buf[pos:pos + <NUM_LIT:12>])<EOL>numbytes = nti(buf[pos + <NUM_LIT:12>:pos + <NUM_LIT>])<EOL><DEDENT>except ValueError:<EOL><INDENT>break<EOL><DEDENT>if offset and numbytes:<EOL><INDENT>structs.append((offset, numbytes))<EOL><DEDENT>pos += <NUM_LIT><EOL><DEDENT>isextended = bool(buf[<NUM_LIT>])<EOL><DEDENT>self.sparse = structs<EOL>self.offset_data = tarfile.fileobj.tell()<EOL>tarfile.offset = self.offset_data + self._block(self.size)<EOL>self.size = origsize<EOL>return self<EOL>
Process a GNU sparse header plus extra headers.