On Thu, 13 Feb 2014, Rajkumar Balakrishnasamy wrote:
I am trying to read the corrupt image xls document using poi library.But
problem is  I am retrieving the bytesRemaining value wrongly

Actual value I am getting:
55028

Expected value:
120564

as bytes read is also 120564  which causes negative  array index exception
in the line  _remainingData = new byte[bytesRemaining].how can be it fixed?

Looks like your file has less data in it than it ought to for a given record, and we're reading off the end of it

please provide any suggestions

First, we need to know if it's a corrupted file, or if it's something we can work around. Does the Binary File Format Validator pass it? Can Excel read it? Where did it come from?

Then, you'll likely need to read the [MS-XLS] file format spec, and compare the values in your file to that. Are there optional bits that POI is always reading for example?

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to