Skip to content
Snippets Groups Projects
Commit a9f5c045 authored by Boris Osher's avatar Boris Osher Committed by Sean Busbey
Browse files

[s3] S3Client could not estimate read perfomance correctly (#1010)

closes #994 
parent 385a3898
No related branches found
No related tags found
No related merge requests found
......@@ -429,7 +429,11 @@ public class S3Client extends DB {
// writing the stream to bytes and to results
int sizeOfFile = (int)objectAndMetadata.getValue().getContentLength();
byte[] inputStreamToByte = new byte[sizeOfFile];
objectData.read(inputStreamToByte, 0, sizeOfFile);
int len;
int offset = 0;
while ((len = objectData.read(inputStreamToByte, offset, sizeOfFile - offset)) > 0) {
offset += len;
}
result.put(key, new ByteArrayByteIterator(inputStreamToByte));
objectData.close();
objectAndMetadata.getKey().close();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment