question: public void readData ( DataInput din ) throws IOException { m_length = din . readUnsignedByte ( ) ; if ( m_length < 2 || m_length > 255 ) { return ; } m_slaveId = din . readUnsignedByte ( ) ; m_status = din . readUnsignedByte ( ) ; m_data = new byte [ m_length - 2 ] ; if ( m_length > 2 ) { din . readFully ( m_data , 0 , m_length - 2 ) ; } }
target:  readData -- input the Modbus message from din.  If there was a header, such as for Modbus/TCP, it will have been read already.