From d3d14176cadb06c026d8964cbb034eff4226d78b Mon Sep 17 00:00:00 2001 From: Daniel Trnka Date: Mon, 6 Jan 2020 12:29:06 +0100 Subject: [PATCH] ReadBufferDataHandle: fixed calculating local offset offset should not be cast to int before modulo operation --- src/main/java/org/scijava/io/handle/ReadBufferDataHandle.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/scijava/io/handle/ReadBufferDataHandle.java b/src/main/java/org/scijava/io/handle/ReadBufferDataHandle.java index 6f092f759..258d9731d 100644 --- a/src/main/java/org/scijava/io/handle/ReadBufferDataHandle.java +++ b/src/main/java/org/scijava/io/handle/ReadBufferDataHandle.java @@ -185,7 +185,7 @@ private byte[] readPage(final int pageID, final int slotID) throws IOException { * Calculates the offset in the current page for the given global offset */ private int globalToLocalOffset(final long off) { - return (int) off % pageSize; + return (int) (off % pageSize); } @Override