code: public BitVector readInputDiscretes(int unitId, int ref, int count) throws ModbusException {
          checkTransaction();
          if (readInputDiscretesRequest == null) {
              readInputDiscretesRequest = new ReadInputDiscretesRequest();
          }
          readInputDiscretesRequest.setUnitID(unitId);
          readInputDiscretesRequest.setReference(ref);
          readInputDiscretesRequest.setBitCount(count);
          transaction.setRequest(readInputDiscretesRequest);
          transaction.execute();
          BitVector bv = ((ReadInputDiscretesResponse)getAndCheckResponse()).getDiscretes();
          bv.forceSize(count);
          return bv;
      }
docs: Reads a given number of input discrete states from the slave.
  
  Note that the number of bits in the bit vector will be
  forced to the number originally requested.
  
  @param unitId the slave unit id.
  @param ref    the offset of the input discrete to start reading from.
  @param count  the number of input discrete states to be read.
  
  @return a <tt>BitVector</tt> instance holding the received input discrete
  states.
  
  @throws ModbusException if an I/O error, a slave exception or
  a transaction error occurs.