@Override
    public void accept(SortableFeature item) {
      assert !sorted;
      try {
        features.incrementAndGet();
        currentChunk.add(item);
        if (currentChunk.bytesInMemory > chunkSizeLimit) {
          newChunk();
        }
      } catch (IOException e) {
        throw new UncheckedIOException(e);
      }
    }
Writer that a single thread can use to write features independent of writers used in other threads.
planetiler-core/src/main/java/com/onthegomap/planetiler/collection/ExternalMergeSort.java