@Override
    SortableFeature readNextFeature() {
      if (read < count) {
        long nextSort = buffer.getLong();
        int length = buffer.getInt();
        byte[] bytes = new byte[length];
        buffer.get(bytes);
        read++;
        return new SortableFeature(nextSort, bytes);
      } else {
        return null;
      }
    }
Memory-map the chunk file, then iterate through all features in it.
planetiler-core/src/main/java/com/onthegomap/planetiler/collection/ExternalMergeSort.java