gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/stats/BitSeries.java
public double[] getValuesEx(int typeCode, int samplesToSkip,
	        int resultSize) {
	      double[] result = new double[resultSize];
	      int firstInterval = 0;
	      int idx = 0;
	      while (samplesToSkip > 0
	          && firstInterval <= intervalIdx
	          && intervals[firstInterval].getSampleCount() <= samplesToSkip) {
	        samplesToSkip -= intervals[firstInterval].getSampleCount();
	        firstInterval++;
	      }
	      for (int i = firstInterval; i <= intervalIdx; i++) {
	        idx += intervals[i].fill(result, idx, typeCode, samplesToSkip);
	        samplesToSkip = 0;
	      }
	      if (currentCount != 0) {
	        idx += BitInterval.create(currentStartBits, currentInterval,
	            currentCount).fill(result, idx, typeCode, samplesToSkip);
	      }
	      // assert
	      if (idx != resultSize) {
	        throw new RuntimeException("GetValuesEx didn't fill the last "
	            + (resultSize - idx) + " entries of its result");
	      }
	      return result;
	    }
public double[] getValuesEx(int typeCode, int samplesToSkip,
	        int resultSize) {
	      double[] result = new double[resultSize];
	      int firstInterval = 0;
	      int idx = 0;
	      while (samplesToSkip > 0
	          && firstInterval <= intervalIdx
	          && intervals[firstInterval].getSampleCount() <= samplesToSkip) {
	        samplesToSkip -= intervals[firstInterval].getSampleCount();
	        firstInterval++;
	      }
	      for (int i = firstInterval; i <= intervalIdx; i++) {
	        idx += intervals[i].fill(result, idx, typeCode, samplesToSkip);
	        samplesToSkip = 0;
	      }
	      if (currentCount != 0) {
	        idx += BitInterval.create(currentStartBits, currentInterval,
	            currentCount).fill(result, idx, typeCode, samplesToSkip);
	      }
	      // assert
	      if (idx != resultSize) {
	        throw new RuntimeException("GetValuesEx didn't fill the last "
	            + (resultSize - idx) + " entries of its result");
	      }
	      return result;
	    }
/*
Gets the first "resultSize" values of this series skipping over the first
"samplesToSkip" ones. The first value in a series is at index 0. The
maximum result size can be obtained by calling "getSize()".