mirror of https://github.com/apache/poi.git
Bug 17890: Corrected exception text for zero byte file.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@425384 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3499a86c40
commit
53b06e968b
|
@ -72,6 +72,9 @@ public class HeaderBlockReader
|
||||||
|
|
||||||
if (byte_count != POIFSConstants.BIG_BLOCK_SIZE)
|
if (byte_count != POIFSConstants.BIG_BLOCK_SIZE)
|
||||||
{
|
{
|
||||||
|
if (byte_count == -1)
|
||||||
|
//Cant have -1 bytes read in the error message!
|
||||||
|
byte_count = 0;
|
||||||
String type = " byte" + ((byte_count == 1) ? ("")
|
String type = " byte" + ((byte_count == 1) ? ("")
|
||||||
: ("s"));
|
: ("s"));
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,10 @@ public class RawDataBlock
|
||||||
}
|
}
|
||||||
else if (count != POIFSConstants.BIG_BLOCK_SIZE)
|
else if (count != POIFSConstants.BIG_BLOCK_SIZE)
|
||||||
{
|
{
|
||||||
|
if (count == -1)
|
||||||
|
//Cant have -1 bytes read in the error message!
|
||||||
|
count = 0;
|
||||||
|
|
||||||
String type = " byte" + ((count == 1) ? ("")
|
String type = " byte" + ((count == 1) ? ("")
|
||||||
: ("s"));
|
: ("s"));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue