Fix AbstractDiskHttpData int conversion from long

Motivations:
The chunkSize might be oversized after comparison (size being > of int
capacity) if file size is bigger than an integer.

Modifications:
Change it to long.

Result:
There is no more int oversized.

Same fix for 4.1 and Master
This commit is contained in:
Frederic Bregier 2014-12-07 13:19:20 +01:00 committed by Norman Maurer
parent 3957a88a94
commit 9b2fede68e

View File

@ -341,11 +341,11 @@ public abstract class AbstractDiskHttpData extends AbstractHttpData {
FileOutputStream outputStream = new FileOutputStream(dest);
FileChannel in = inputStream.getChannel();
FileChannel out = outputStream.getChannel();
int chunkSize = 8196;
long chunkSize = 8196;
long position = 0;
while (position < size) {
if (chunkSize < size - position) {
chunkSize = (int) (size - position);
chunkSize = size - position;
}
position += in.transferTo(position, chunkSize , out);
}