def METHOD_NAME(self, data, flush=False):
    if self.ttyrec is None:
        return
    with util.SlowWarning("Slow IO: write_ttyrec_chunk '%s'" % self.desc):
        t = time.time()
        self.write_ttyrec_header(int(t), int((t % 1) * 1000000), len(data))
        self.ttyrec.write(data)
    if flush:
        self.flush_ttyrec()