diff --git a/src/com/studentersamfundet/app/FeedFetcher.java b/src/com/studentersamfundet/app/FeedFetcher.java index 0862162..985d36e 100644 --- a/src/com/studentersamfundet/app/FeedFetcher.java +++ b/src/com/studentersamfundet/app/FeedFetcher.java @@ -127,8 +127,9 @@ public class FeedFetcher { OutputStream os = c.openFileOutput(LOCAL_FILENAME, Context.MODE_PRIVATE); byte[] inputBuffer = new byte[BUFFER_SIZE]; - while (in.read(inputBuffer) > 0) { - os.write(inputBuffer); + int bytes = 0; + while ((bytes = in.read(inputBuffer)) > 0) { + os.write(inputBuffer, 0, bytes); inputBuffer = new byte[BUFFER_SIZE]; } os.close();