When downloading a rar file from the internet with the code below, the downloaded file is larger than it actually is. Not sure what causes this?
bis = new BufferedInputStream(urlConn.getInputStream());
bos = new BufferedOutputStream(new FileOutputStream(outputFile));
eventBus.fireEvent(this, new DownloadStartedEvent(item));
int read;
byte[] buffer = new byte[2048];
while ((read = bis.read(buffer)) != -1) {
bos.write(buffer);
}
eventBus.fireEvent(this, new DownloadCompletedEvent(item));