mirror of https://github.com/apache/poi.git
Patch from Antoni Mylka from bug #51535 - correct signed vs unsigned short reading in NDocumentInputStream
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1156573 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
abad8d1b09
commit
5cbd261957
|
@ -34,6 +34,7 @@
|
|||
|
||||
<changes>
|
||||
<release version="3.8-beta4" date="2011-??-??">
|
||||
<action dev="poi-developers" type="fix">51535 - correct signed vs unsigned short reading in NDocumentInputStream</action>
|
||||
<action dev="poi-developers" type="add">51634 - support SXSSF streaming from templates</action>
|
||||
<action dev="poi-developers" type="add">initial support for XSLF usermodel API</action>
|
||||
<action dev="poi-developers" type="fix">51187 - fixed OPCPackage to correctly handle self references</action>
|
||||
|
|
|
@ -275,7 +275,10 @@ public final class NDocumentInputStream extends DocumentInputStream {
|
|||
|
||||
@Override
|
||||
public short readShort() {
|
||||
return (short) readUShort();
|
||||
checkAvaliable(SIZE_SHORT);
|
||||
byte[] data = new byte[SIZE_SHORT];
|
||||
readFully(data, 0, SIZE_SHORT);
|
||||
return LittleEndian.getShort(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -291,7 +294,7 @@ public final class NDocumentInputStream extends DocumentInputStream {
|
|||
checkAvaliable(SIZE_SHORT);
|
||||
byte[] data = new byte[SIZE_SHORT];
|
||||
readFully(data, 0, SIZE_SHORT);
|
||||
return LittleEndian.getShort(data);
|
||||
return LittleEndian.getUShort(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2144,9 +2144,9 @@ if(1==2) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Large row numbers
|
||||
* Large row numbers and NPOIFS vs POIFS
|
||||
*/
|
||||
public void DISABLEDtest51535() throws Exception {
|
||||
public void test51535() throws Exception {
|
||||
byte[] data = HSSFITestDataProvider.instance.getTestDataFileContent("51535.xls");
|
||||
|
||||
HSSFWorkbook wbPOIFS = new HSSFWorkbook(new POIFSFileSystem(
|
||||
|
|
Loading…
Reference in New Issue