public final class ChunkReader extends Object
Each chunk will be self-contained and parsable, for example by wrapping it in a
ByteArrayInputStream and using the JfrLoaderToolkit.
| Modifier and Type | Method and Description |
|---|---|
static void |
main(String[] args)
Program for listing the number of chunks in a recording.
|
static Iterator<byte[]> |
readChunks(File jfrFile)
Reads a JFR file, chunk by chunk.
|
static Iterator<byte[]> |
readChunks(InputStream jfrStream)
Reads a JFR file, chunk by chunk, from a stream.
|
public static Iterator<byte[]> readChunks(File jfrFile) throws IOException
Each chunk will be self contained and parsable, for example by wrapping it in a
ByteArrayInputStream. Note that Iterator.next() can throw
IllegalArgumentException if it encounters a corrupted chunk.
jfrFile - the file to read binary data fromIOExceptionpublic static Iterator<byte[]> readChunks(InputStream jfrStream) throws IOException
Each chunk will be self contained and parsable, for example by wrapping it in a
ByteArrayInputStream. Note that Iterator.next() can throw
IllegalArgumentException if it encounters a corrupted chunk.
jfrStream - the stream to read binary data fromIOExceptionpublic static void main(String[] args) throws IOException
args - takes one argument, which must be the path to a recordingIOException - if there was a problem reading the fileCopyright © 2020. All rights reserved.