salesforce / zsync4j

Java port of zsync
BSD 3-Clause "New" or "Revised" License
35 stars 14 forks source link

Long type should be used #2

Open Ntropy opened 8 years ago

Ntropy commented 8 years ago

Here should be used long type for first argument to support huge files. zsync-core/src/main/java/com/salesforce/zsync/internal/OutputFileWriter.java#L139

lauzond commented 4 years ago

I agree with Ntropy, zsync-core/src/main/java/com/salesforce/zsync/internal/OutputFileWriter.java#L139 should force long arithmetic with: (((long) position) * this.blockSize)

Likewise, zsync-core/src/main/java/com/salesforce/zsync/internal/OutputFileWriter.java#L156 should force long arithmetic with: (start, ((long) i) * this.blockSize - 1)

and

zsync-core/src/main/java/com/salesforce/zsync/internal/OutputFileWriter.java#L162 should force long arithmetic with: ((long) i) * this.blockSize