code: public void readData(DataInput input) throws IOException {
          readReference = input.readUnsignedShort();
          readCount = input.readUnsignedShort();
          writeReference = input.readUnsignedShort();
          writeCount = input.readUnsignedShort();
          int byteCount = input.readUnsignedByte();
  
          if (nonWordDataHandler == null) {
              byte buffer[] = new byte[byteCount];
              input.readFully(buffer, 0, byteCount);
  
              int offset = 0;
              registers = new Register[writeCount];
  
              for (int register = 0; register < writeCount; register++) {
                  registers[register] = new SimpleRegister(buffer[offset], buffer[offset + 1]);
                  offset += 2;
              }
          }
          else {
              nonWordDataHandler.readData(input, writeReference, writeCount);
          }
      }
docs: readData -- read the values of the registers to be written, along with
  the reference and count for the registers to be read.