@Override
    public void forEachBlock(Consumer<Block> consumer) {
      try (FileChannel channel = openChannel()) {
        final long size = channel.size();
        while (channel.position() < size) {
          BlobHeader header = readBlobHeader(channel);
          int blockSize = header.getDatasize();
          String headerType = header.getType();
          long blockStartPosition = channel.position();
          if ("OSMData".equals(headerType)) {
            consumer.accept(new LazyBlock(blockStartPosition, blockSize, lazyReadChannel));
          } else if ("OSMHeader".equals(headerType)) {
            validateHeader(readBytes(channel, blockStartPosition, blockSize));
          } else {
            LOGGER.warn("Unrecognized OSM PBF blob header type: {}", headerType);
          }
          channel.position(blockStartPosition + blockSize);
        }
      } catch (IOException e) {
        throw new UncheckedIOException(e);
      }
    }
An OSM block reader that iterates through the input file in a single thread, skipping over each block and just
passing the position/offset to workers so they can read the contents from disk in parallel.
<p>
This may result in a speedup on some systems.
planetiler-core/src/main/java/com/onthegomap/planetiler/reader/osm/OsmInputFile.java