Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Increased maximum buffer size in network file transfers
Browse files Browse the repository at this point in the history
From 4096 bytes to 32768 bytes

Closes #57
  • Loading branch information
NFM-8 authored and moxie-signal committed Jul 28, 2018
1 parent 9eee689 commit 60ac83d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ private void downloadAttachment(String url, File localDestination, int maxSizeBy

OutputStream output = new FileOutputStream(localDestination);
InputStream input = connection.getInputStream();
byte[] buffer = new byte[4096];
byte[] buffer = new byte[32768];
int contentLength = connection.getContentLength();
int read,totalRead = 0;

Expand Down Expand Up @@ -521,7 +521,7 @@ private byte[] uploadAttachment(String method, String url, InputStream data,

try {
DigestingOutputStream out = outputStreamFactory.createFor(connection.getOutputStream());
byte[] buffer = new byte[4096];
byte[] buffer = new byte[32768];
int read, written = 0;

while ((read = data.read(buffer)) != -1) {
Expand Down Expand Up @@ -582,7 +582,7 @@ private void downloadFromCdn(File destination, String path, int maxSizeBytes)

InputStream in = body.byteStream();
OutputStream out = new FileOutputStream(destination);
byte[] buffer = new byte[4096];
byte[] buffer = new byte[32768];

int read, totalRead = 0;

Expand Down

0 comments on commit 60ac83d

Please sign in to comment.