*/
public static long calculateMaximumSize(final POIFSBigBlockSize bigBlockSize,
final int numBATs) {
- long size = 1; // Header isn't FAT addressed
+ // Header isn't FAT addressed
+ long size = 1;
// The header has up to 109 BATs, and extra ones are referenced
// from XBATs
// However, all BATs can contain 128/1024 blocks
- size += (numBATs * bigBlockSize.getBATEntriesPerBlock());
+ size += (((long)numBATs) * bigBlockSize.getBATEntriesPerBlock());
// So far we've been in sector counts, turn into bytes
return size * bigBlockSize.getBigBlockSize();
Double leftMargin = paragraph.getLeftMargin();\r
if (leftMargin == null) {\r
// if the marL attribute is omitted, then a value of 347663 is implied\r
- leftMargin = Units.toPoints(347663*indentLevel);\r
+ leftMargin = Units.toPoints(347663L*indentLevel);\r
}\r
Double indent = paragraph.getIndent();\r
if (indent == null) {\r
- indent = Units.toPoints(347663*indentLevel);\r
+ indent = Units.toPoints(347663L*indentLevel);\r
}\r
if (isHSLF()) {\r
// special handling for HSLF\r
* @return The result right padded with 0
*/
public static String toHex(int value) {
- return xpad(value & 0xFFFFFFFF, 8, "");
+ return xpad(value & 0xFFFFFFFFL, 8, "");
}
/**