diff options
author | Andrew Gaul <andrew@gaul.org> | 2013-06-30 22:11:50 -0700 |
---|---|---|
committer | Andrew Gaul <andrew@gaul.org> | 2013-06-30 22:12:59 -0700 |
commit | 07e64d8deddad56f763b32ddac17333f3229420a (patch) | |
tree | c710705b49c286041f57e5d9b080e8ce89fac0e6 /src/de | |
parent | 62961d6594687eb34e36adaeba55a90c99e2dd4e (diff) | |
download | AntennaPod-07e64d8deddad56f763b32ddac17333f3229420a.zip |
Flush BufferedOutputStream correctly
This ensures that IOException due to writes are thrown in the main
code path instead of the exceptional code path. Specifically for
HttpDownloader this ensures that IOUtils.closeQuietly does not swallow
a failed write.
Diffstat (limited to 'src/de')
-rw-r--r-- | src/de/danoeh/antennapod/service/download/HttpDownloader.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/de/danoeh/antennapod/service/download/HttpDownloader.java b/src/de/danoeh/antennapod/service/download/HttpDownloader.java index f8f26f6fd..8ba1a5a41 100644 --- a/src/de/danoeh/antennapod/service/download/HttpDownloader.java +++ b/src/de/danoeh/antennapod/service/download/HttpDownloader.java @@ -63,7 +63,7 @@ public class HttpDownloader extends Downloader { @Override protected void download() { DefaultHttpClient httpClient = null; - OutputStream out = null; + BufferedOutputStream out = null; InputStream connection = null; try { HttpGet httpGet = new HttpGet(status.getFeedFile() @@ -113,6 +113,7 @@ public class HttpDownloader extends Downloader { if (cancelled) { onCancelled(); } else { + out.flush(); onSuccess(); } } else { |