(self, size)
return t[:size]
Return size bytes from the stream.
Return size bytes from the stream.
Return size bytes from the stream .
def _read(self, size):
        """Return size bytes from the stream.
        """
        if self.comptype == "tar":
            return self.__read(size)

        c = len(self.dbuf)
        t = [self.dbuf]
        while c < size:
            # Skip underlying buffer to avoid unaligned double buffering.
            if self.buf:
                buf = self.buf
                self.buf = b""
            else:
                buf = self.fileobj.read(self.bufsize)
                if not buf:
                    break
            try:
                buf = self.cmp.decompress(buf)
            except self.exception as e:
                raise ReadError("invalid compressed data") from e
            t.append(buf)
            c += len(buf)
        t = b"".join(t)
        self.dbuf = t[size:]
        return t[:size]
def _read ( self , size ) : if self . comptype == "tar" : return self . __read ( size ) c = len ( self . dbuf ) t = [ self . dbuf ] while c < size : # Skip underlying buffer to avoid unaligned double buffering. if self . buf : buf = self . buf self . buf = b"" else : buf = self . fileobj . read ( self . bufsize ) if not buf : break try : buf = self . cmp . decompress ( buf ) except self . exception as e : raise ReadError ( "invalid compressed data" ) from e t . append ( buf ) c += len ( buf ) t = b"" . join ( t ) self . dbuf = t [ size : ] return t [ : size ]