void clearInput ( ) throws IOException { if ( commPort . bytesAvailable ( ) > 0 ) { int len = commPort . bytesAvailable ( ) ; byte buf [ ] = new byte [ len ] ; readBytes ( buf , len ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Clear input: {}" , ModbusUtil . toHex ( buf , 0 , len ) ) ; } } }
clearInput - Clear the input if characters are found in the input stream .