Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [3.1.7]

### Added

### Changed
- Changed chunkInputStream method in LargeFileUploadTask to resolve IndexOutOfBoundsException when uploading large files

## [3.1.6] - 2024-02-29

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public IUploadSession updateSessionStatus() {
return session;
}
private UploadResult<T> uploadSlice(UploadSliceRequestBuilder<T> uploadSliceRequestBuilder, ArrayList<Throwable> exceptionsList) throws IOException {
byte[] buffer = chunkInputStream(uploadStream,(int) uploadSliceRequestBuilder.getRangeBegin(), (int)uploadSliceRequestBuilder.getRangeLength());
byte[] buffer = chunkInputStream(uploadStream, (int)uploadSliceRequestBuilder.getRangeLength());
ByteArrayInputStream chunkStream = new ByteArrayInputStream(buffer);
try {
return uploadSliceRequestBuilder.put(chunkStream);
Expand Down Expand Up @@ -275,9 +275,9 @@ private long nextSliceSize(long rangeBegin, long rangeEnd) {
long size = rangeEnd - rangeBegin + 1;
return Math.min(size, this.maxSliceSize);
}
private byte[] chunkInputStream(InputStream stream, int begin, int length) throws IOException {
private byte[] chunkInputStream(InputStream stream, int length) throws IOException {
byte[] buffer = new byte[length];
int lengthAssert = stream.read(buffer, begin, length);
int lengthAssert = stream.read(buffer);
assert lengthAssert == length;
return buffer;
}
Expand Down