'Read up to size uncompressed bytes, while trying to avoid
making multiple reads from the underlying stream.
Returns b\'\' if the file is at EOF.'

def read1(self, size=(-1)):

    with self._lock:
        self._check_can_read()
        if ((size == 0) or ((self._buffer_offset == len(self._buffer)) and (not self._fill_buffer()))):
            return ''
        if (size > 0):
            data = self._buffer[self._buffer_offset:(self._buffer_offset + size)]
            self._buffer_offset += len(data)
        else:
            data = self._buffer[self._buffer_offset:]
            self._buffer = ''
            self._buffer_offset = 0
        self._pos += len(data)
        return data
