@Override
      public void put(long key, long value) {
        long offset = key << 3;
        long segment = offset >>> segmentBits;
        if (segment < lastSegment) {
          throw new IllegalStateException("Writer encountered of order IDs at " + key);
        } else if (segment > lastSegment) {
          if (segment >= Integer.MAX_VALUE) {
            throw new IllegalArgumentException("Segment " + segment + " >= Integer.MAX_VALUE");
          }

          lastSegment = segment;
          segmentOffset = segment << segmentBits;
          buffer = getOrCreateSegment((int) segment);
        }

        buffer.putLong((int) (offset - segmentOffset), value);
      }
A map from sequential {@code long} keys to {@code long} values backed by {@link ByteBuffer ByteBuffers} segments
in-memory where key defines the segment and offset into that segment.
planetiler-core/src/main/java/com/onthegomap/planetiler/collection/ArrayLongLongMapRam.java