title: Read serial data java in one line
body: <p>I'm making a project with a rs485 module.<br/>
  Every time the module sends data to my com port i want to catch that data.<br/>
  And that's works, I can catch it. But when I catch it I see it in multiple lines. </p>
  
  <p>My data starts every time with <code>*</code> and ends with <code>#</code>.</p>
  
  <p>Can you help my to catch the data in only 1 line ? Thanks ! </p>
  
  <pre><code>public void serialEvent(SerialPortEvent event) {
      //if(event.isRXCHAR() &amp;&amp; event.getEventValue() &gt; 0) {
      try {
  
          String receivedData = serialPort.readString(event.getEventValue());
          while (receivedData.charAt(0) == '#') {
              receivedData = receivedData.substring(1, receivedData.length());
          }
          System.out.println("Received response from port: " + receivedData);
      } catch (SerialPortException ex) {
          System.out.println("Error in receiving response from port: " + ex);
      }
      //}
  }
  </code></pre>