'Output the given string over the serial port.'

def write(self, data):

    if (not self.is_open):
        raise portNotOpenError
    try:
        self._port_handle.Write(as_byte_array(data), 0, len(data))
    except System.TimeoutException:
        raise writeTimeoutError
    return len(data)
