private static class ChunkReader.ChunkIterator
extends java.lang.Object
implements java.util.Iterator<byte[]>
Iterator.next()
, and the resulting byte array will only be reachable for as long
as it is referenced. The JFR file must not be zip or gzip compressed.
Note that Iterator.next()
can throw IllegalArgumentException
if it encounters
a corrupted chunk.
Modifier and Type | Field and Description |
---|---|
private java.nio.MappedByteBuffer |
buffer |
private java.nio.channels.FileChannel |
channel |
private java.io.RandomAccessFile |
file |
(package private) int |
lastChunkOffset |
Modifier | Constructor and Description |
---|---|
private |
ChunkIterator(java.io.File jfrFile) |
Modifier and Type | Method and Description |
---|---|
private boolean |
bufferHasMagic(int[] magicBytes) |
private boolean |
checkHasMore() |
boolean |
hasNext() |
byte[] |
next() |
void |
remove() |
int lastChunkOffset
private java.io.RandomAccessFile file
private final java.nio.channels.FileChannel channel
private final java.nio.MappedByteBuffer buffer
private ChunkIterator(java.io.File jfrFile) throws java.io.IOException
java.io.IOException
public boolean hasNext()
hasNext
in interface java.util.Iterator<byte[]>
private boolean checkHasMore()
public byte[] next()
next
in interface java.util.Iterator<byte[]>
private boolean bufferHasMagic(int[] magicBytes)
public void remove()
remove
in interface java.util.Iterator<byte[]>