SerialPort p = (SerialPort) CommPortIdentifier.getPortIdentifier(
args[0]).open(TwoPortSerialTest.class.getName(), 0);
p.setSerialPortParams(baudRate, dataBits + requiredExtraBits,
SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
p.enableReceiveTimeout(10000);
InputStream in = p.getInputStream();
while (in.available() != 0) {
in.read();
}