private boolean downloadImage(File targetFile) throws IOException { InputStream is = getDownloader().getStream(uri, options.getExtraForDownloader()); boolean loaded; try { OutputStream os = new BufferedOutputStream(new FileOutputStream(targetFile), BUFFER_SIZE); try { loaded = IoUtils.copyStream(is, os, this); } finally { IoUtils.closeSilently(os); } } finally { IoUtils.closeSilently(is); } return loaded; }