Recording allows to save recorded data into file using dump() method (as shown in example below copied from the javadoc). Is there a way how to get such recorded data in form of byte[].
Preferably without external dependencies. I'm aware of implementing custom in-memory FileSystem.
Configuration c = Configuration.getConfiguration("default");
Recording r = new Recording(c);
r.start();
System.gc();
Thread.sleep(5000);
r.stop();
r.dump(Files.createTempFile("my-recording", ".jfr"));