Skip to content

Commit 803b5ec

Browse files
Fix error "Offset and length were out of bounds for the array or count is greater .." when disposing ByteArrayInputStream.
1 parent 0884487 commit 803b5ec

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dotnet/src/dotnetframework/GxOffice/poi/xssf/ExcelSpreadsheet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ private bool SaveAsImpl(string fileName)
7373
ByteArrayOutputStream fs = new ByteArrayOutputStream();
7474
_workbook.Write(fs);
7575

76-
ByteArrayInputStream inStream = new ByteArrayInputStream(fs.ToByteArray());
76+
MemoryStream inStream = new MemoryStream(fs.ToByteArray());
7777
fs.Close();
7878
_workbook.Close();
7979

dotnet/test/DotNetCoreUnitTest/Excel/ExcelPoiTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void TestCellStyle1()
3838
excel.SetColumnWidth(1, 100);
3939
excel.GetCells(2, 1, 1, 5).NumericValue = 123.456M;
4040
ExcelStyle newCellStyle = new ExcelStyle();
41-
newCellStyle. CellFont. Bold = true;
41+
newCellStyle.CellFont.Bold = true;
4242
excel.GetCells(2, 1, 1, 5).SetCellStyle(newCellStyle);
4343

4444
bool ok = excel.Save();

0 commit comments

Comments
 (0)