mirror of https://github.com/apache/poi.git
fix bug in read() method
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352111 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3354e19583
commit
dd50b4d49b
|
@ -236,7 +236,7 @@ public class DocumentInputStream
|
|||
_tiny_buffer = new byte[ 1 ];
|
||||
}
|
||||
_document.read(_tiny_buffer, _current_offset++);
|
||||
return _tiny_buffer[ 0 ];
|
||||
return ((int)_tiny_buffer[ 0 ]) & 0x000000FF;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -217,8 +217,10 @@ public class TestDocumentInputStream
|
|||
|
||||
for (int j = 0; j < _workbook_size; j++)
|
||||
{
|
||||
int b = stream.read();
|
||||
assertTrue("checking sign of " + j, b >= 0);
|
||||
assertEquals("validating byte " + j, _workbook_data[ j ],
|
||||
( byte ) stream.read());
|
||||
( byte ) b);
|
||||
remaining--;
|
||||
assertEquals("checking remaining after reading byte " + j,
|
||||
remaining, stream.available());
|
||||
|
|
Loading…
Reference in New Issue