mirror of https://github.com/apache/poi.git
[github-348] tidy up number casting
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1902803 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
32069e6f5a
commit
ad6af709b8
|
@ -92,7 +92,7 @@ public abstract class XSSFBParser {
|
|||
b2 &= ~(1<<7); //unset highest bit (if it exists?)
|
||||
recordId = ((int)b2 << 7)+(int)b1;
|
||||
} else {
|
||||
recordId = (int)b1;
|
||||
recordId = b1;
|
||||
}
|
||||
|
||||
long recordLength = 0;
|
||||
|
@ -102,7 +102,7 @@ public abstract class XSSFBParser {
|
|||
byte b = is.readByte();
|
||||
halt = (b >> 7 & 1) == 0; //if highest bit !=1 then continue
|
||||
b &= ~(1<<7);
|
||||
recordLength += (int)b << (i*7); //multiply by 128^i
|
||||
recordLength += (long) (int)b << (i*7); //multiply by 128^i
|
||||
i++;
|
||||
|
||||
}
|
||||
|
|
|
@ -101,8 +101,8 @@ public class ContinuableRecordInput implements LittleEndianInput {
|
|||
((long)b5 << 40) +
|
||||
((long)b4 << 32) +
|
||||
((long)b3 << 24) +
|
||||
(b2 << 16) +
|
||||
(b1 << 8) +
|
||||
((long)b2 << 16) +
|
||||
((long)b1 << 8) +
|
||||
(b0));
|
||||
}
|
||||
|
||||
|
|
|
@ -172,11 +172,11 @@ public abstract class ChunkedCipherInputStream extends LittleEndianInputStream {
|
|||
|
||||
private void nextChunk() throws GeneralSecurityException, IOException {
|
||||
if (chunkSize != -1) {
|
||||
int index = (int)(pos >> chunkBits);
|
||||
int index = (int) (pos >> chunkBits);
|
||||
initCipherForBlock(cipher, index);
|
||||
|
||||
if (lastIndex != index) {
|
||||
long skipN = (index - lastIndex) << chunkBits;
|
||||
long skipN = ((long) index - lastIndex) << chunkBits;
|
||||
if (super.skip(skipN) < skipN) {
|
||||
throw new EOFException("buffer underrun");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue