code: final public int[] readWriteMultipleRegisters(int serverAddress, int readAddress, int readQuantity, int writeAddress, int[] registers) throws
              ModbusProtocolException, ModbusNumberException, ModbusIOException {
          ModbusRequest request = ModbusRequestBuilder.getInstance().buildReadWriteMultipleRegisters(serverAddress, readAddress, readQuantity, writeAddress, registers);
          ReadWriteMultipleRegistersResponse response = (ReadWriteMultipleRegistersResponse) processRequest(request);
          return response.getRegisters();
      }
docs: This function code performs a combination of one read operation and one write operation in a
  single MODBUS transaction. The write operation is performed before the read.
  Holding registers are addressed starting at zero. Therefore holding registers 1-16 are
  addressed in the PDU as 0-15.
  The request specifies the starting address and number of holding registers to be read as well
  as the starting address, number of holding registers, and the data to be written.
  
  @param serverAddress a slave address
  @param readAddress   the address of the registers to be read
  @param readQuantity  the number of registers to be read
  @param writeAddress  the address of the registers to be written
  @param registers     the number of registers to be written
  @return the register value
  @throws ModbusProtocolException if modbus-exception is received
  @throws ModbusNumberException   if response is invalid
  @throws ModbusIOException       if remote slave is unavailable