Skip to content

Commit d3d1417

Browse files
committed
ReadBufferDataHandle: fixed calculating local offset
offset should not be cast to int before modulo operation
1 parent fee2644 commit d3d1417

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/scijava/io/handle/ReadBufferDataHandle.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ private byte[] readPage(final int pageID, final int slotID) throws IOException {
185185
* Calculates the offset in the current page for the given global offset
186186
*/
187187
private int globalToLocalOffset(final long off) {
188-
return (int) off % pageSize;
188+
return (int) (off % pageSize);
189189
}
190190

191191
@Override

0 commit comments

Comments
 (0)