Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim-Brooks committed May 2, 2024
1 parent c766939 commit 769292d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,13 @@ public static int copyToCacheFileAligned(IO fc, InputStream input, int fileChann
if (bytesRead <= 0) {
break;
}
bytesCopied = copyToCacheFileAligned(fc, fileChannelPos + bytesCopied, progressUpdater, buffer);
bytesCopied += copyToCacheFileAligned(fc, fileChannelPos + bytesCopied, buffer);
progressUpdater.accept(bytesCopied);
}
return bytesCopied;
}

public static int copyToCacheFileAligned(IO fc, int fileChannelPos, IntConsumer progressUpdater, ByteBuffer buffer)
public static int copyToCacheFileAligned(IO fc, int fileChannelPos, ByteBuffer buffer)
throws IOException {
if (buffer.hasRemaining()) {
// ensure that last write is aligned on 4k boundaries (= page size)
Expand All @@ -218,7 +219,6 @@ public static int copyToCacheFileAligned(IO fc, int fileChannelPos, IntConsumer
buffer.position(buffer.position() + adjustment);
}
int bytesCopied = positionalWrite(fc, fileChannelPos, buffer);
progressUpdater.accept(bytesCopied);
return bytesCopied;
}

Expand Down

0 comments on commit 769292d

Please sign in to comment.