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 /tests/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 'tests/src/de')
-rw-r--r-- | tests/src/de/danoeh/antennapod/test/FeedHandlerTest.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/src/de/danoeh/antennapod/test/FeedHandlerTest.java b/tests/src/de/danoeh/antennapod/test/FeedHandlerTest.java index 132d40eba..daba95dbf 100644 --- a/tests/src/de/danoeh/antennapod/test/FeedHandlerTest.java +++ b/tests/src/de/danoeh/antennapod/test/FeedHandlerTest.java @@ -54,7 +54,7 @@ public class FeedHandlerTest extends AndroidTestCase { for (int i = 0; i < num_retries; i++) { InputStream in = null; - OutputStream out = null; + BufferedOutputStream out = null; try { in = getInputStream(feed.getDownload_url()); assertNotNull(in); @@ -65,6 +65,7 @@ public class FeedHandlerTest extends AndroidTestCase { while ((count = in.read(buffer)) != -1) { out.write(buffer, 0, count); } + out.flush(); successful = true; } catch (IOException e) { e.printStackTrace(); |