(self)
Internal: read binary data.
Internal: read binary data.
Internal : read binary data .
def read_binary(self):
        """Internal: read binary data."""
        self.file = self.make_file()
        todo = self.length
        if todo >= 0:
            while todo > 0:
                data = self.fp.read(min(todo, self.bufsize)) # bytes
                if not isinstance(data, bytes):
                    raise ValueError("%s should return bytes, got %s"
                                     % (self.fp, type(data).__name__))
                self.bytes_read += len(data)
                if not data:
                    self.done = -1
                    break
                self.file.write(data)
                todo = todo - len(data)
def read_binary ( self ) : self . file = self . make_file ( ) todo = self . length if todo >= 0 : while todo > 0 : data = self . fp . read ( min ( todo , self . bufsize ) ) # bytes if not isinstance ( data , bytes ) : raise ValueError ( "%s should return bytes, got %s" % ( self . fp , type ( data ) . __name__ ) ) self . bytes_read += len ( data ) if not data : self . done = - 1 break self . file . write ( data ) todo = todo - len ( data )