I\'m beginner in Java. I\'m reading data from device through serial port. I\'m getting data for every one minute, but first reading is coming half, after that data is coming
Use the following:
while (inputStream.available()>0) { int numBytes = inputStream.read(readBuffer); System.out.print(new String(readBuffer)); }
You are printing the result out of the while loop. However the code inside the loop may run more than once, so chunk of data will be lost.