Quantcast
Viewing all articles
Browse latest Browse all 1621

Commented Unassigned: Buffer overrun while writing a workbook [13159]

Hi,

I'm trying to write an excel using filestream
```
using (FileStream file = new FileStream(selectDest.SelectedPath + @"\Import update LHT.xls", FileMode.Create, FileAccess.Write))
{
wbImport.Write(file);
}
```
and I'm getting this error
```
An unhandled exception of type 'NPOI.Util.RuntimeException' occurred in NPOI.dll

Additional information: Buffer overrun i=111;endIndex=152;writeIndex=43
```

The workbook has only one sheet with about 500 rows so I don't think the size is the problem.

The workbook writing worked until last week and since I keep getting this error and I don't know why.
Comments: ** Comment from web user: tonyqus **

The error is thrown by LittleEndianByteArrayOutputStream class

private void CheckPosition(int i)
{
if (i > _endIndex - _writeIndex)
{
throw new RuntimeException(string.Format(CultureInfo.InvariantCulture, "Buffer overrun i={0};endIndex={1};writeIndex={2}", i, _endIndex, _writeIndex));
}
}

If it used to work, the issue may be caused by the original xls template. I need your complete code and xls file to check what's going on.


Viewing all articles
Browse latest Browse all 1621

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>