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:
Jason Height 2006-07-25 12:19:31 +00:00
parent 3ffa62ef21
commit 79d49c2b67
2 changed files with 7 additions and 0 deletions

View File

@ -72,6 +72,9 @@ public class HeaderBlockReader
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) ? ("")
: ("s"));

View File

@ -56,6 +56,10 @@ public class RawDataBlock
}
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) ? ("")
: ("s"));