Skip to content

Commit

Permalink
FIX NoSuchMethodError: java.nio.MappedByteBuffer.duplicate (#453)
Browse files Browse the repository at this point in the history
Co-authored-by: Maxim Thomas <[email protected]>
  • Loading branch information
vharseko and maximthomas authored Dec 25, 2024
1 parent d46cd38 commit 323cc13
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,7 @@ public MeteredCursor<ByteString, ByteString> flip()
mmapPosition = region.offset;
mmap = channel.map(MapMode.READ_ONLY, mmapPosition, Math.min(size.get() - mmapPosition, Integer.MAX_VALUE));
}
final ByteBuffer regionBuffer = mmap.duplicate();
final ByteBuffer regionBuffer = ((ByteBuffer)mmap).duplicate();
final int relativeRegionOffset = (int) (region.offset - mmapPosition);
regionBuffer.position(relativeRegionOffset).limit(regionBuffer.position() + region.size);
cursors.add(new FileRegion.Cursor(name, regionBuffer.slice()));
Expand Down

0 comments on commit 323cc13

Please sign in to comment.