@Override
    public OsmElement.Way next() {
      if (!hasNext()) {
        throw new NoSuchElementException();
      }
      var way = ways.get(i++);
      // Build up the list of way nodes for the way. The node ids are
      // delta encoded meaning that each id is stored as a delta against
      // the previous one.
      long nodeId = 0;
      int numNodes = way.getRefsCount();
      LongArrayList wayNodesList = new LongArrayList(numNodes);
      wayNodesList.elementsCount = numNodes;
      long[] wayNodes = wayNodesList.buffer;
      for (int j = 0; j < numNodes; j++) {
        long nodeIdOffset = way.getRefs(j);
        nodeId += nodeIdOffset;
        wayNodes[j] = nodeId;
      }

      return new OsmElement.Way(
        way.getId(),
        buildTags(way.getKeysCount(), way::getKeys, way::getVals),
        wayNodesList,
        parseInfo(way.getInfo())
      );
    }
Decompresses and parses a header block of an OSM input file.
planetiler-core/src/main/java/com/onthegomap/planetiler/reader/osm/PbfDecoder.java