code: public static int estimatecompress(int[] in, int currentPos, int inlength) {
  		int tmpoutpos = 0;
  		int finalpos = currentPos + inlength;
  		outer: while (currentPos < finalpos) {
  			mainloop: for (int selector = 0; selector < 8; selector++) {
  
  				int compressedNum = codeNum[selector];
  				if (finalpos <= currentPos + compressedNum - 1)
  					compressedNum = finalpos - currentPos;
  				int b = bitLength[selector];
  				int max = 1 << b;
  				int i = 0;
  				for (; i < compressedNum; i++)
  					if (Util.smallerorequalthan(max , in[currentPos + i]))
  						continue mainloop;
  				currentPos += compressedNum;
  				++tmpoutpos;
  				continue outer;
  			}
  			final int selector = 8;
  			if (in[currentPos] >= 1 << bitLength[selector])
  				throw new RuntimeException("Too big a number");
  			tmpoutpos++;
  			currentPos++;
  
  		}
  		return tmpoutpos;
  	}
docs: Estimate size of the compressed output.
  
  @param in
  array to compress
  @param currentPos
  where to start reading
  @param inlength
  how many integers to read
  @return estimated size of the output (in 32-bit integers)