question: public void readData ( DataInput din ) throws IOException { byteCount = din . readByte ( ) ; status = din . readUnsignedShort ( ) ; eventCount = din . readUnsignedShort ( ) ; messageCount = din . readUnsignedShort ( ) ; events = new byte [ byteCount - 6 ] ; if ( events . length > 0 ) { din . readFully ( events , 0 , events . length ) ; } }
target:  readData -- input the Modbus message from din. If there was a header, such as for Modbus/TCP, it will have been read already.