本文整理汇总了C#中NPOI.HSSF.UserModel.HSSFWorkbook.GetBytes方法的典型用法代码示例。如果您正苦于以下问题:C# HSSFWorkbook.GetBytes方法的具体用法?C# HSSFWorkbook.GetBytes怎么用?C# HSSFWorkbook.GetBytes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NPOI.HSSF.UserModel.HSSFWorkbook
的用法示例。
在下文中一共展示了HSSFWorkbook.GetBytes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestSheetSerializeSizeMisMatch_bug45066
public void TestSheetSerializeSizeMisMatch_bug45066()
{
HSSFWorkbook wb = new HSSFWorkbook();
InternalSheet sheet = ((HSSFSheet)wb.CreateSheet("Sheet1")).Sheet;
IList sheetRecords = sheet.Records;
// one way (of many) to cause the discrepancy is with a badly behaved record:
sheetRecords.Add(new BadlyBehavedRecord());
// There is also much logic inside Sheet that (if buggy) might also cause the discrepancy
try
{
wb.GetBytes();
throw new AssertionException("Identified bug 45066 a");
}
catch (InvalidOperationException e)
{
// Expected badly behaved sheet record to cause exception
Assert.IsTrue(e.Message.StartsWith("Actual serialized sheet size"));
}
}