From 9924828eb01b54bfee288209076b0a89319ce1dd Mon Sep 17 00:00:00 2001 From: Todd Hill Date: Fri, 19 Apr 2024 13:45:40 -0400 Subject: [PATCH] Change int to long to support very large files --- .../src/main/java/com/example/s3/BasicOpsWithChecksums.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/javav2/example_code/s3/src/main/java/com/example/s3/BasicOpsWithChecksums.java b/javav2/example_code/s3/src/main/java/com/example/s3/BasicOpsWithChecksums.java index 471a13b1eab..83979861f3c 100644 --- a/javav2/example_code/s3/src/main/java/com/example/s3/BasicOpsWithChecksums.java +++ b/javav2/example_code/s3/src/main/java/com/example/s3/BasicOpsWithChecksums.java @@ -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()