code: 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);
          }
      }
docs: readData -- input the Modbus message from din. If there was a header,
  such as for Modbus/TCP, it will have been read already.
  @throws java.io.IOException If the data cannot be read