code: public static SequenceQuality create(QualityFormat format, byte[] data, int from, int length, boolean check) {
          if (from + length >= data.length || from < 0 || length < 0)
              throw new IllegalArgumentException();
          //For performance
          final byte valueOffset = format.getOffset(),
                  minValue = format.getMinValue(),
                  maxValue = format.getMaxValue();
          byte[] res = new byte[length];
          int pointer = from;
          for (int i = 0; i < length; i++) {
              res[i] = (byte) (data[pointer++] - valueOffset);
  
              if (check &&
                      (res[i] < minValue || res[i] > maxValue))
                  throw new WrongQualityFormat(((char) (data[i])) + " [" + res[i] + "]");
          }
          return new SequenceQuality(res, true);
      }
docs: Factory method for the SequenceQualityPhred object. It performs all necessary range checks if required.
  
  @param format format of encoded quality values
  @param data   byte with encoded quality values
  @param from   starting position in {@code data}
  @param length number of bytes to parse
  @param check  determines whether range check is required
  @return quality line object
  @throws WrongQualityFormat if encoded value are out of range and checking is enabled