-
Notifications
You must be signed in to change notification settings - Fork 969
Open
Labels
bugThis issue is a bug.This issue is a bug.p2This is a standard priority issueThis is a standard priority issue
Description
Describe the bug
I have an empty S3 object. When I create an InputStream to that object and invoke "read()" I get back an int "212".
Expected Behavior
I would expect InputStream.read() to an empty S3Object to return -1.
Current Behavior
Currently it returns a single byte 212.
Reproduction Steps
When executed against a 0 byte (empty) S3Object the following code returns 212. It should return -1
var getObjectRequest =
GetObjectRequest.builder()
.bucket("bucket")
.key(
"emptyobject")
.build();
try (var fileContent =
s3Client.getObject(getObjectRequest, ResponseTransformer.toInputStream())) {
System.out.println(fileContent.read());
}
Possible Solution
I don't know but the problem appears to be in the software.amazon.awssdk.services.s3.checksums.ChecksumValidatingInputStream class. That is where the result diverges from using something like InputStream.readAllBytes().
Additional Information/Context
No response
AWS Java SDK version used
2.17.283
JDK version used
17
Operating System and version
Windows 11
kandelk, nineinchnick and martynassateika
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.p2This is a standard priority issueThis is a standard priority issue