code: public static int verifyQuality(Text quality, BaseQualityEncoding encoding)
  	{
  		// set allowed quality range
  		int max, min;
  
  		if (encoding == BaseQualityEncoding.Illumina)
  		{
  			max = FormatConstants.ILLUMINA_OFFSET + FormatConstants.ILLUMINA_MAX;
  			min = FormatConstants.ILLUMINA_OFFSET;
  		}
  		else if (encoding == BaseQualityEncoding.Sanger)
  		{
  			max = FormatConstants.SANGER_OFFSET + FormatConstants.SANGER_MAX;
  			min = FormatConstants.SANGER_OFFSET;
  		}
  		else
  			throw new IllegalArgumentException("Unsupported base encoding quality " + encoding);
  
  		// verify
  		final byte[] bytes = quality.getBytes();
  		final int len = quality.getLength();
  
  		for (int i = 0; i < len; ++i)
  		{
  			if (bytes[i] < min || bytes[i] > max)
  				return i;
  		}
  		return -1;
  	}
docs: Verify that the given quality bytes are within the range allowed for the specified encoding.
  
  In theory, the Sanger encoding uses the entire
  range of characters from ASCII 33 to 126, giving a value range of [0,93].  However, values over 60 are
  unlikely in practice, and are more likely to be caused by mistaking a file that uses Illumina encoding
  for Sanger.  So, we'll enforce the same range supported by Illumina encoding ([0,62]) for Sanger.
  
  @return -1 if quality is ok.
  @return If an out-of-range value is found the index of the value is returned.