Skip to content

Commit

Permalink
refactor: InboxFileStreamWriter.writeStream method improvements (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
djenczewski committed Dec 6, 2024
1 parent 56f2ee4 commit ed3bb00
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ public void writeStream(long inboxHandle, InputStream inputStream, StoreFileStre
if (streamController != null) {
setProgressListener(streamController);
}
byte[] chunk = new byte[(int) StoreFileStream.OPTIMAL_SEND_SIZE];
byte[] chunk = new byte[(int) InboxFileStream.OPTIMAL_SEND_SIZE];
int readed;
while (true) {
if (streamController != null && streamController.isStopped()) {
break;
return;
}
if ((readed = inputStream.read(chunk)) <= 0) {
break;
return;
}
write(inboxHandle, Arrays.copyOf(chunk, readed));
}
Expand Down

0 comments on commit ed3bb00

Please sign in to comment.