@Override public Integer valueArrayBinaryGet(DataInput2 input, int keysLen, int pos) throws IOException { input.unpackLongSkip(pos); return input.unpackInt(); }
@Override public Long valueArrayBinaryGet(DataInput2 input, int keysLen, int pos) throws IOException { input.unpackLongSkip(pos); return input.unpackLong(); }
@Override public Long valueArrayBinaryGet(DataInput2 input, int keysLen, int pos) throws IOException { input.unpackLongSkip(pos); return deserialize(input,-1); } }
@Override public int valueArrayBinarySearch(Long key, DataInput2 input, int keysLen, Comparator comparator) throws IOException { if (comparator != this) return super.valueArrayBinarySearch(key, input, keysLen, comparator); long key2 = key; for (int pos = 0; pos < keysLen; pos++) { long from = input.unpackLong(); if (key2 <= from) { input.unpackLongSkip(keysLen - pos - 1); return (key2 == from) ? pos : -(pos + 1); } } //not found return -(keysLen + 1); }
@Override public int valueArrayBinarySearch(Integer key, DataInput2 input, int keysLen, Comparator comparator) throws IOException { if (comparator != this) return super.valueArrayBinarySearch(key, input, keysLen, comparator); int key2 = key; for (int pos = 0; pos < keysLen; pos++) { int from = input.unpackInt(); if (key2 <= from) { input.unpackLongSkip(keysLen-pos-1); return (key2 == from) ? pos : -(pos + 1); } } //not found return -(keysLen + 1); }
@Override public int valueArrayBinarySearch(Long key, DataInput2 input, int keysLen, Comparator comparator) throws IOException { if (comparator != this) return super.valueArrayBinarySearch(key, input, keysLen, comparator); long key2 = key; long from = 0; for (int pos = 0; pos < keysLen; pos++) { from += input.unpackLong(); if (key2 <= from) { input.unpackLongSkip(keysLen-pos-1); return (key2 == from) ? pos : -(pos + 1); } } //not found return -(keysLen + 1); }
@Override public int valueArrayBinarySearch(Integer key, DataInput2 input, int keysLen, Comparator comparator) throws IOException { if (comparator != this) return super.valueArrayBinarySearch(key, input, keysLen, comparator); int key2 = key; int from = 0; for (int pos = 0; pos < keysLen; pos++) { from += input.unpackInt(); if (key2 <= from) { input.unpackLongSkip(keysLen-pos-1); return (key2 == from) ? pos : -(pos + 1); } } //not found return -(keysLen + 1); }
input.unpackLongSkip(pos-1); return input.unpackLong();