Writes a boolean to the underlying output file as a 1-byte value.

def write_bool(self, flag):
        """ Writes a boolean to the underlying output file as a 1-byte value. """
        if flag:
            self.write(b"\x01")
        else:
            self.write(b"\x00")