Removed not nessary input/output buffering

This commit is contained in:
M66B
2019-07-26 08:39:05 +02:00
parent c4e29a9539
commit de963c56b7
10 changed files with 35 additions and 47 deletions

View File

@@ -54,8 +54,6 @@ import org.jsoup.safety.Whitelist;
import org.jsoup.select.NodeTraversor;
import org.jsoup.select.NodeVisitor;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@@ -459,7 +457,7 @@ public class HtmlHelper {
Log.i("Downloaded image source=" + source);
try (OutputStream os = new BufferedOutputStream(new FileOutputStream(file))) {
try (OutputStream os = new FileOutputStream(file)) {
bm.compress(Bitmap.CompressFormat.PNG, 90, os);
}
@@ -638,7 +636,7 @@ public class HtmlHelper {
EntityAttachment attachment = db.attachment().getAttachment(id, cid);
if (attachment != null && attachment.available) {
File file = attachment.getFile(context);
try (InputStream is = new BufferedInputStream(new FileInputStream(file))) {
try (InputStream is = new FileInputStream(file)) {
byte[] bytes = new byte[(int) file.length()];
if (is.read(bytes) != bytes.length)
throw new IOException("length");