(self, data)
Write a 256-byte block to tape.
Write a 256-byte block to tape.
Write a 256 - byte block to tape .
def _write_block(self, data):
        """Write a 256-byte block to tape."""
        # fill out short blocks with last byte
        data += data[-1:]*(256-len(data))
        for b in iterchar(data):
            self.bitstream.write_byte(ord(b))
        crc_word = crc(data)
        # crc is written big-endian
        lo, hi = (ord(_b) for _b in iterchar(struct.pack('<H', crc_word)))
        self.bitstream.write_byte(hi)
        self.bitstream.write_byte(lo)
def _write_block ( self , data ) : # fill out short blocks with last byte data += data [ - 1 : ] * ( 256 - len ( data ) ) for b in iterchar ( data ) : self . bitstream . write_byte ( ord ( b ) ) crc_word = crc ( data ) # crc is written big-endian lo , hi = ( ord ( _b ) for _b in iterchar ( struct . pack ( '<H' , crc_word ) ) ) self . bitstream . write_byte ( hi ) self . bitstream . write_byte ( lo )