protected Map<JFREventType, EventAggregator> collectMultiEvents() throws IOException {
        Map<JFREventType, EventAggregator> event2aggMap = new HashMap<>();

        for (Event event; (event = jfr.readEvent()) != null; ) {
            EventAggregator agg = null;
            if (event instanceof ExecutionSample) {
                agg = event2aggMap.computeIfAbsent(EXECUTION_SAMPLE, JFRConverter::getEventAggregator);
            } else if (event instanceof AllocationSample) {
                AllocationSample allocationSample = (AllocationSample) event;
                if (allocationSample.tlabSize != 0) {
                    agg = event2aggMap.computeIfAbsent(OBJECT_ALLOCATION_IN_NEW_TLAB, JFRConverter::getEventAggregator);
                } else {
                    agg = event2aggMap.computeIfAbsent(OBJECT_ALLOCATION_OUTSIDE_TLAB, JFRConverter::getEventAggregator);
                }
            } else if (event instanceof ContendedLock) {
                agg = event2aggMap.computeIfAbsent(LOCK, JFRConverter::getEventAggregator);
            } else if (event instanceof LiveObject) {
                agg = event2aggMap.computeIfAbsent(PROFILER_LIVE_OBJECT, JFRConverter::getEventAggregator);
            }
            if (agg != null) {
                agg.collect(event);
            }
        }

        return event2aggMap;
    }
JFRConverter is copied from one.jfr.JfrConverter. Because need to
add collectMultiEvents and getEventAggregator methods, to parse 
and process multiple events at one time.
oap-server/server-library/library-async-profiler-jfr-parser/src/main/java/one/jfr/JFRConverter.java