|
33 | 33 | import javax.crypto.AEADBadTagException; |
34 | 34 | import javax.crypto.KeyGenerator; |
35 | 35 | import javax.crypto.SecretKey; |
| 36 | +import java.io.BufferedInputStream; |
36 | 37 | import java.io.IOException; |
37 | 38 | import java.io.InputStream; |
38 | 39 | import java.nio.charset.StandardCharsets; |
@@ -331,7 +332,9 @@ public void customSetBufferSizeWithLargeObject() throws IOException { |
331 | 332 |
|
332 | 333 | // Tight bound on the custom buffer size limit of 32MiB |
333 | 334 | final long fileSizeExceedingDefaultLimit = 1024 * 1024 * 32 + 1; |
334 | | - final InputStream largeObjectStream = new BoundedInputStream(fileSizeExceedingDefaultLimit); |
| 335 | + final InputStream largeObjectStream = new BufferedInputStream( |
| 336 | + new BoundedInputStream(fileSizeExceedingDefaultLimit) |
| 337 | + ); |
335 | 338 | v3ClientWithBuffer32MiB.putObject(PutObjectRequest.builder() |
336 | 339 | .bucket(BUCKET) |
337 | 340 | .key(objectKey) |
@@ -385,7 +388,9 @@ public void customSetBufferSizeWithLargeObjectAsyncClient() throws IOException { |
385 | 388 |
|
386 | 389 | // Tight bound on the custom buffer size limit of 32MiB |
387 | 390 | final long fileSizeExceedingDefaultLimit = 1024 * 1024 * 32 + 1; |
388 | | - final InputStream largeObjectStream = new BoundedInputStream(fileSizeExceedingDefaultLimit); |
| 391 | + final InputStream largeObjectStream = new BufferedInputStream( |
| 392 | + new BoundedInputStream(fileSizeExceedingDefaultLimit) |
| 393 | + ); |
389 | 394 | ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor(); |
390 | 395 | CompletableFuture<PutObjectResponse> futurePut = v3ClientWithBuffer32MiB.putObject(PutObjectRequest.builder() |
391 | 396 | .bucket(BUCKET) |
@@ -438,7 +443,9 @@ public void delayedAuthModeWithLargeObject() throws IOException { |
438 | 443 |
|
439 | 444 | // Tight bound on the default limit of 64MiB |
440 | 445 | final long fileSizeExceedingDefaultLimit = 1024 * 1024 * 64 + 1; |
441 | | - final InputStream largeObjectStream = new BoundedInputStream(fileSizeExceedingDefaultLimit); |
| 446 | + final InputStream largeObjectStream = new BufferedInputStream( |
| 447 | + new BoundedInputStream(fileSizeExceedingDefaultLimit) |
| 448 | + ); |
442 | 449 | v3Client.putObject(PutObjectRequest.builder() |
443 | 450 | .bucket(BUCKET) |
444 | 451 | .key(objectKey) |
|
0 commit comments