Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,19 @@ public void upload(final List<Option> options,
byte[] buffer = new byte[chunkSize];

while (this.readSoFar < this.streamSize) {
int read = this.inputStream.read(buffer);

if (read == -1) {
break;
int buffRead = 0;

while (buffRead < chunkSize) {
int read = 0;
Comment thread
zengin marked this conversation as resolved.
read = this.inputStream.read(buffer, buffRead, chunkSize - buffRead);
if (read == -1) {
break;
}
buffRead += read;
}

ChunkedUploadRequest request =
new ChunkedUploadRequest(this.uploadUrl, this.client, options, buffer, read,
new ChunkedUploadRequest(this.uploadUrl, this.client, options, buffer, buffRead,
Comment thread
zengin marked this conversation as resolved.
maxRetry, this.readSoFar, this.streamSize);
ChunkedUploadResult<UploadType> result = request.upload(this.responseHandler);

Expand All @@ -190,7 +195,7 @@ public void upload(final List<Option> options,
break;
}

this.readSoFar += read;
this.readSoFar += buffRead;
}
}

Expand Down