(self, nbytes=-1)
Read bytes from a file on tape.
Read bytes from a file on tape.
Read bytes from a file on tape .
def read(self, nbytes=-1):
        """Read bytes from a file on tape."""
        c = b''
        try:
            while True:
                if nbytes > -1:
                    c += self.record_stream.read(nbytes-len(c))
                    if len(c) >= nbytes:
                        return c
                else:
                    c += self.record_stream.read()
                if self.buffer_complete:
                    return c
                self._fill_record_buffer()
        except EndOfTape:
            return c
def read ( self , nbytes = - 1 ) : c = b'' try : while True : if nbytes > - 1 : c += self . record_stream . read ( nbytes - len ( c ) ) if len ( c ) >= nbytes : return c else : c += self . record_stream . read ( ) if self . buffer_complete : return c self . _fill_record_buffer ( ) except EndOfTape : return c