(self)
Write the tape buffer to tape.
Write the tape buffer to tape.
Write the tape buffer to tape .
def _flush_record_buffer(self):
        """Write the tape buffer to tape."""
        if self.filetype not in (b'M', b'B', b'P') and self.rwmode == 'w':
            data = self.record_stream.getvalue()
            while True:
                if len(data) < 255:
                    break
                chunk, data = data[:255], data[255:]
                # ascii and data come as a sequence of one-block records
                # 256 bytes less 1 length byte. CRC trailer comes after 256-byte block
                self._write_record(b'\0' + chunk)
            self.record_stream = io.BytesIO()
            self.record_stream.write(data)
            self.record_stream.seek(0, 2)
def _flush_record_buffer ( self ) : if self . filetype not in ( b'M' , b'B' , b'P' ) and self . rwmode == 'w' : data = self . record_stream . getvalue ( ) while True : if len ( data ) < 255 : break chunk , data = data [ : 255 ] , data [ 255 : ] # ascii and data come as a sequence of one-block records # 256 bytes less 1 length byte. CRC trailer comes after 256-byte block self . _write_record ( b'\0' + chunk ) self . record_stream = io . BytesIO ( ) self . record_stream . write ( data ) self . record_stream . seek ( 0 , 2 )