int (int left, int right) { if (left < 0 || left > right || right > size()) { throw new IllegalArgumentException("Size is: " + size() + ", but interval is: (" + left + ", " + right + ")"); } if (left == size()) return 0; int startIndex = myStartIndexMap.getLongIndex(left); int sum = 0; for (int i = 0; i < right - left; i++) { int sizeOf = getNextStartIndex(startIndex) - startIndex; sum += ByteArrayUtils.readDelta(startIndex, sizeOf, myCompressedDeltas); startIndex += sizeOf; } return sum; }