// values for tracking file output streams and matching data chunks with initial files
int currentDataChunkNumber;
int bytesDownloadedFromChunk;
- int bytesToDownload;
+ long bytesToDownload;
byte[] currentDataChunk;
boolean remainingDataInChunk;
final List<KeepLocator> keepLocators;
this.keepLocators = keepLocators;
}
- private int getBytesToDownload() {
+ private long getBytesToDownload() {
return bytesToDownload;
}
- private void setBytesToDownload(int bytesToDownload) {
+ private void setBytesToDownload(long bytesToDownload) {
this.bytesToDownload = bytesToDownload;
}
private void writeDownDataChunkPartially(FileOutputStream fos) throws IOException {
//write all remaining bytes for this file from current chunk
- fos.write(currentDataChunk, bytesDownloadedFromChunk, bytesToDownload);
+ fos.write(currentDataChunk, bytesDownloadedFromChunk, (int) bytesToDownload);
// update number of bytes downloaded from this chunk
bytesDownloadedFromChunk += bytesToDownload;
// set remaining data in chunk to true
public static final String FILE_TOKEN_INFO = "0:1024:test-file1";
public static final int FILE_POSITION = 0;
- public static final int FILE_LENGTH = 1024;
+ public static final long FILE_LENGTH = 1024L;
public static final String FILE_NAME = "test-file1";
public static final String FILE_PATH = "c" + Characters.SLASH;