Skip to content

Commit

Permalink
Change int to long to support very large files
Browse files Browse the repository at this point in the history
  • Loading branch information
tkhill-AWS authored and DavidSouther committed Apr 24, 2024
1 parent 658e44e commit 9924828
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ public void multipartUploadWithChecksumS3Client(String filePath) {

try (RandomAccessFile file = new RandomAccessFile(filePath, "r")) {
long fileSize = file.length();
int position = 0;
long position = 0;
while (position < fileSize) {
file.seek(position);
int read = file.getChannel().read(bb);
long read = file.getChannel().read(bb);

bb.flip(); // Swap position and limit before reading from the buffer.
UploadPartRequest uploadPartRequest = UploadPartRequest.builder()
Expand Down

0 comments on commit 9924828

Please sign in to comment.