private void newChunk() throws IOException {
      Path chunkPath = dir.resolve("chunk" + chunkNum.incrementAndGet());
      FileUtils.deleteOnExit(chunkPath);
      if (currentChunk != null) {
        currentChunk.close();
      }
      chunks.add(currentChunk = new Chunk(chunkPath));
    }
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