From 65a4a25101e75b4d28858db07c5fe67d2c0cd668 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 23 Aug 2018 09:47:01 +0000 Subject: [PATCH] Small improvement --- app/src/main/java/eu/faircode/email/ActivityView.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java index 9adfb440..da698aca 100644 --- a/app/src/main/java/eu/faircode/email/ActivityView.java +++ b/app/src/main/java/eu/faircode/email/ActivityView.java @@ -74,6 +74,8 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack private boolean newIntent = false; + private static final int ATTACHMENT_BUFFER_SIZE = 8192; // bytes + static final int REQUEST_VIEW = 1; static final int REQUEST_UNSEEN = 2; @@ -631,7 +633,7 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack fos = new FileOutputStream(pfd.getFileDescriptor()); fis = new FileInputStream(file); - byte[] buffer = new byte[4096]; + byte[] buffer = new byte[ATTACHMENT_BUFFER_SIZE]; int read; while ((read = fis.read(buffer)) != -1) { fos.write(buffer, 0, read);