def close(self):
if self.closed:<EOL><INDENT>return<EOL><DEDENT>if self.mode == "<STR_LIT:w>" and self.comptype != "<STR_LIT>":<EOL><INDENT>self.buf += self.cmp.flush()<EOL><DEDENT>if self.mode == "<STR_LIT:w>" and self.buf:<EOL><INDENT>self.fileobj.write(self.buf)<EOL>self.buf = b"<STR_LIT>"<EOL>if self.comptype == "<STR_LIT>":<EOL><INDENT>self.fileobj.write(struct.pack("<STR_LIT>", self.crc & <NUM_LIT>))<EOL>self.fileobj.write(struct.pack("<STR_LIT>", self.pos & <NUM_LIT>))<EOL><DEDENT><DEDENT>if not self._extfileobj:<EOL><INDENT>self.fileobj.close()<EOL><DEDENT>self.closed = True<EOL>
Close the _Stream object. No operation should be
           done on it afterwards.