Is there another way to save the workbook besides using workbook.Write(Stream)? If the workbook is very large, having to duplicate it in a byte array to feed to the file stream runs the system out of memory. If we had direct access to the data being returned by
GetBytes() we may be able write the file without running out of memory.
The current error being generated is:
Message: Exception of type 'System.OutOfMemoryException' was thrown.
TargetSite: Byte GetBytes()
at NPOI.HSSF.UserModel.HSSFWorkbook.Write(Stream stream)
UtilityWorker.WriteToFile(HSSFWorkbook hssfWorkbook, String fileName)