def read1(self, n):
<EOL>if n < <NUM_LIT:0> or n is None:<EOL><INDENT>n = self.MAX_N<EOL><DEDENT>len_readbuffer = len(self._readbuffer) - self._offset<EOL>if self._compress_left > <NUM_LIT:0> and n > len_readbuffer + len(self._unconsumed):<EOL><INDENT>nbytes = n - len_readbuffer - len(self._unconsumed)<EOL>nbytes = max(nbytes, self.MIN_READ_SIZE)<EOL>nbytes = min(nbytes, self._compress_left)<EOL>data = self._fileobj.read(nbytes)<EOL>self._compress_left -= len(data)<EOL>if data and self._decrypter is not None:<EOL><INDENT>data = '<STR_LIT>'.join(map(self._decrypter, data))<EOL><DEDENT>if self._compress_type == ZIP_STORED:<EOL><INDENT>self._update_crc(data, eof=(self._compress_left==<NUM_LIT:0>))<EOL>self._readbuffer = self._readbuffer[self._offset:] + data<EOL>self._offset = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>self._unconsumed += data<EOL><DEDENT><DEDENT>if (len(self._unconsumed) > <NUM_LIT:0> and n > len_readbuffer and<EOL>self._compress_type == ZIP_DEFLATED):<EOL><INDENT>data = self._decompressor.decompress(<EOL>self._unconsumed,<EOL>max(n - len_readbuffer, self.MIN_READ_SIZE)<EOL>)<EOL>self._unconsumed = self._decompressor.unconsumed_tail<EOL>eof = len(self._unconsumed) == <NUM_LIT:0> and self._compress_left == <NUM_LIT:0><EOL>if eof:<EOL><INDENT>data += self._decompressor.flush()<EOL><DEDENT>self._update_crc(data, eof=eof)<EOL>self._readbuffer = self._readbuffer[self._offset:] + data<EOL>self._offset = <NUM_LIT:0><EOL><DEDENT>data = self._readbuffer[self._offset: self._offset + n]<EOL>self._offset += len(data)<EOL>return data<EOL>
Read up to n bytes with at most one read() system call.