Download an object by using a stream

Note: This example assumes that the Bucket sample exists.

Example: Download an object using a stream

AmazonS3 s3Client = new AmazonS3Client();
s3Client.setEndpoint("https://systemname.example.com");
S3Object returned = CLIENT.getObject( 1
"sample", 2
"serialized-object" 3
);
S3ObjectInputStream s3Input = s3Response.getObjectContent(); 4

1 Request the object by identifying…
2 The sample Bucket
3 The serialized-object Object
4 Set the object stream.