本文整理匯總了C#中NPOI.POIFS.FileSystem.NPOIFSFileSystem.GetBlockAt方法的典型用法代碼示例。如果您正苦於以下問題:C# NPOIFSFileSystem.GetBlockAt方法的具體用法?C# NPOIFSFileSystem.GetBlockAt怎麽用?C# NPOIFSFileSystem.GetBlockAt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類NPOI.POIFS.FileSystem.NPOIFSFileSystem
的用法示例。
在下文中一共展示了NPOIFSFileSystem.GetBlockAt方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: TestDocumentInputStream
public TestDocumentInputStream()
{
int blocks = (_workbook_size + 511) / 512;
_workbook_data = new byte[512 * blocks];
Arrays.Fill(_workbook_data, unchecked((byte)-1));
for (int j = 0; j < _workbook_size; j++)
{
_workbook_data[j] = (byte)(j * j);
}
// Create the Old POIFS Version
RawDataBlock[] rawBlocks = new RawDataBlock[blocks];
MemoryStream stream =
new MemoryStream(_workbook_data);
for (int j = 0; j < blocks; j++)
{
rawBlocks[j] = new RawDataBlock(stream);
}
POIFSDocument document = new POIFSDocument("Workbook", rawBlocks,
_workbook_size);
_workbook_o = new DocumentNode(
document.DocumentProperty,
new DirectoryNode(
new DirectoryProperty("Root Entry"), (POIFSFileSystem)null, null));
// Now create the NPOIFS Version
byte[] _workbook_data_only = new byte[_workbook_size];
Array.Copy(_workbook_data, 0, _workbook_data_only, 0, _workbook_size);
NPOIFSFileSystem npoifs = new NPOIFSFileSystem();
// Make it easy when debugging to see what isn't the doc
byte[] minus1 = new byte[512];
Arrays.Fill(minus1, unchecked((byte)-1));
npoifs.GetBlockAt(-1).Write(minus1);
npoifs.GetBlockAt(0).Write(minus1);
npoifs.GetBlockAt(1).Write(minus1);
// Create the NPOIFS document
_workbook_n = (DocumentNode)npoifs.CreateDocument(
new MemoryStream(_workbook_data_only),
"Workbook"
);
}