private void convertScaleOffsetUnsignedShort(IndexIterator iterIn, IndexIterator iterOut) { boolean checkMissing = useNaNs && hasMissing(); while (iterIn.hasNext()) { short valb = iterIn.getShortNext(); double val = scale * DataType.unsignedShortToInt(valb) + offset; iterOut.setDoubleNext(checkMissing && isMissing_(val) ? Double.NaN : val); } }
public double convertScaleOffsetMissing(short vals) { if (!hasScaleOffset) return useNaNs && isMissing((double) vals) ? Double.NaN : (double) vals; double convertedValue; if (isUnsigned) convertedValue = scale * DataType.unsignedShortToInt(vals) + offset; else convertedValue = scale * vals + offset; return useNaNs && isMissing(convertedValue) ? Double.NaN : convertedValue; }