@Override
  public long get(long key) {
    int chunk = (int) (key >>> 8);
    int offset = (int) (key & 255);
    if (chunk >= offsets.size()) {
      return MISSING_VALUE;
    }

    long lo = offsets.getLong(chunk);
    long hi = Math.min(values.size(), chunk >= offsets.size() - 1 ? values.size() : offsets.getLong(chunk + 1L)) - 1;
    int startPad = offsetStartPad.get(chunk) & 255;

    long index = lo + offset - startPad;

    if (index > hi || index < lo) {
      return MISSING_VALUE;
    }

    return values.getLong(index);
  }
A longlong map that only stores values and uses the key as an index into the array, with some tweaks to avoid storing
many sequential 0's.
planetiler-core/src/main/java/com/onthegomap/planetiler/collection/SparseArrayLongLongMap.java