title: write a string to a serial port in java
body: <p>i want to write a string to a serial port, but serial port write method allows only byte array to write in it...so how can i send whole string to a port..here is my code... </p>
  
  <pre><code>      serialPort.setSerialPortParams(300,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
         OutputStream mOutputToPort = serialPort.getOutputStream();
  
          String mValue = "ABCDEFG";
            System.out.println("beginning to Write . \r\n");
           mOutputToPort.write(mValue.getBytes());
           System.out.println("AT Command Written to Port. \r\n");
           mOutputToPort.flush();
  </code></pre>
  
  <p>i dont want to send it one by one char..i want whole at a time... thnxx in advance</p>