public static void loadDump(@NotNull File file, @NotNull CachedValueProfiler.EventConsumer consumer) throws IOException {
    try (JsonReader reader = new JsonReader(new InputStreamReader(new GZIPInputStream(
      new BufferedInputStream(new FileInputStream(file))), StandardCharsets.UTF_8))) {
      reader.beginObject();
      int version = 0;
      while (reader.hasNext()) {
        String name = reader.nextName();
        if (_VERSION.equals(name)) version = reader.nextInt();
        if (_DATA.equals(name)) break;
      }
      if (version != VERSION) {
        throw new IOException("Unsupported version: " + version + " (" + VERSION + " required)");
      }

      reader.beginArray();
      String type = "";
      Map<String, StackTraceElement> places = FactoryMap.create(o -> placeFromString(o));
      while (reader.hasNext()) {
        StackTraceElement place = null;
        long frame = 0, parent = 0, t1 = 0, t2 = 0, t3 = 0;
        reader.beginObject();
        while (reader.hasNext()) {
          String name = reader.nextName();
          if (_TYPE.equals(name)) type = reader.nextString();
          else if (_PLACE.equals(name)) place = places.get(reader.nextString());
          else if (_FRAME_ID.equals(name)) frame = reader.nextLong();
          else if (_FRAME_PID.equals(name)) parent = reader.nextLong();
          else if (_T1.equals(name)) t1 = reader.nextLong();
          else if (_T2.equals(name)) t2 = reader.nextLong();
          else if (_T3.equals(name)) t3 = reader.nextLong();
          else throw new IOException("unexpected: " + name);
        }
        reader.endObject();
        if (_FRAME_ENTER.equals(type)) consumer.onFrameEnter(frame, eventPlace(place), parent, t1);
        else if (_FRAME_EXIT.equals(type)) consumer.onFrameExit(frame, t1, t2, t3);
        else if (_VALUE_COMPUTED.equals(type)) consumer.onValueComputed(frame, eventPlace(place), t1, t2);
        else if (_VALUE_USED.equals(type)) consumer.onValueUsed(frame, eventPlace(place), t1, t2);
        else if (_VALUE_INVALIDATED.equals(type)) consumer.onValueInvalidated(frame, eventPlace(place), t1, t2);
        else if (_VALUE_REJECTED.equals(type)) consumer.onValueRejected(frame, eventPlace(place), t1, t2, t3);
      }
      reader.endArray();

      // allow extra content at the end
      //reader.endObject();
    }
  }
public static void loadDump(@NotNull File file, @NotNull CachedValueProfiler.EventConsumer consumer)