X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Fasynctasks%2FSaveUrl.java;h=c93070951eeb352d380b90590fac9d53f230d4b0;hp=7d981c0f324a554cded0809515aca0c578a8fdbd;hb=f4126c24a54f9af846371bb1515e072a818060c1;hpb=7e0198f9aef9900b2c400b278e08f3e8273f2593 diff --git a/app/src/main/java/com/stoutner/privacybrowser/asynctasks/SaveUrl.java b/app/src/main/java/com/stoutner/privacybrowser/asynctasks/SaveUrl.java index 7d981c0f..c9307095 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/asynctasks/SaveUrl.java +++ b/app/src/main/java/com/stoutner/privacybrowser/asynctasks/SaveUrl.java @@ -170,7 +170,8 @@ public class SaveUrl extends AsyncTask { InputStream inputStream = new BufferedInputStream(httpUrlConnection.getInputStream()); // Initialize the conversion buffer byte array. - byte[] conversionBufferByteArray = new byte[1024]; + // This is set to a megabyte so that frequent updating of the snackbar doesn't freeze the interface on download. + byte[] conversionBufferByteArray = new byte[1048576]; // Initialize the downloaded kilobytes counter. long downloadedKilobytesCounter = 0; @@ -198,9 +199,6 @@ public class SaveUrl extends AsyncTask { } } - // Flush the output stream. - outputStream.flush(); - // Close the output stream. outputStream.close(); } catch (Exception exception) {