--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/RecordingInput.java Wed Jul 03 22:51:44 2019 +0200
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/RecordingInput.java Fri Jul 05 03:36:40 2019 +0200
@@ -40,9 +40,10 @@
private static final class Block {
private byte[] bytes = new byte[0];
private long blockPosition;
- private int size;
+ private long blockPositionEnd;
+
boolean contains(long position) {
- return position >= blockPosition && position < blockPosition + size;
+ return position >= blockPosition && position < blockPositionEnd;
}
public void read(RandomAccessFile file, int amount) throws IOException {
@@ -51,7 +52,7 @@
if (amount > bytes.length) {
bytes = new byte[amount];
}
- this.size = amount;
+ this.blockPositionEnd = blockPosition + amount;
file.readFully(bytes, 0 , amount);
}
@@ -61,7 +62,7 @@
public void reset() {
blockPosition = 0;
- size = 0;
+ blockPositionEnd = 0;
}
}