本文整理汇总了C#中NPOI.POIFS.FileSystem.DirectoryNode.CreateDocumentInputStream方法的典型用法代码示例。如果您正苦于以下问题:C# DirectoryNode.CreateDocumentInputStream方法的具体用法?C# DirectoryNode.CreateDocumentInputStream怎么用?C# DirectoryNode.CreateDocumentInputStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NPOI.POIFS.FileSystem.DirectoryNode
的用法示例。
在下文中一共展示了DirectoryNode.CreateDocumentInputStream方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EncryptionInfo
public EncryptionInfo(DirectoryNode dir)
{
DocumentInputStream dis = dir.CreateDocumentInputStream("EncryptionInfo");
versionMajor = dis.ReadShort();
versionMinor = dis.ReadShort();
encryptionFlags = dis.ReadInt();
if (versionMajor == 4 && versionMinor == 4 && encryptionFlags == 0x40)
{
StringBuilder builder = new StringBuilder();
byte[] xmlDescriptor = new byte[dis.Available()];
dis.Read(xmlDescriptor);
foreach (byte b in xmlDescriptor)
builder.Append((char)b);
string descriptor = builder.ToString();
header = new EncryptionHeader(descriptor);
verifier = new EncryptionVerifier(descriptor);
}
else
{
int hSize = dis.ReadInt();
header = new EncryptionHeader(dis);
if (header.Algorithm == EncryptionHeader.ALGORITHM_RC4)
{
verifier = new EncryptionVerifier(dis, 20);
}
else
{
verifier = new EncryptionVerifier(dis, 32);
}
}
}
示例2: CreateFromEmbeddedOleObject
/// <summary>
/// Creates an instance of this class from an embedded OLE Object. The OLE Object is expected
/// to include a stream "{01}Ole10Native" which contains the actual
/// data relevant for this class.
/// </summary>
/// <param name="directory">directory POI Filesystem object</param>
/// <returns>Returns an instance of this class</returns>
public static Ole10Native CreateFromEmbeddedOleObject(DirectoryNode directory)
{
bool plain = false;
try
{
directory.GetEntry("\u0001Ole10ItemName");
plain = true;
}
catch (FileNotFoundException)
{
plain = false;
}
DocumentEntry nativeEntry =
(DocumentEntry)directory.GetEntry(OLE10_NATIVE);
byte[] data = new byte[nativeEntry.Size];
directory.CreateDocumentInputStream(nativeEntry).Read(data);
return new Ole10Native(data, 0, plain);
}
示例3: GetDataStream
public override Stream GetDataStream(DirectoryNode dir)
{
DocumentInputStream dis = dir.CreateDocumentInputStream("EncryptedPackage");
_length = dis.ReadLong();
return new ChunkedCipherInputStream(dis, _length, this);
}
示例4: Open
private void Open(DirectoryNode directory)
{
DocumentNode book = (DocumentNode)directory.GetEntry("Book");
if (book == null)
{
throw new IOException("No Excel 5/95 Book stream found");
}
ris = new RecordInputStream(directory.CreateDocumentInputStream(book));
Prepare();
}
示例5: GetPropertySet
PropertySet GetPropertySet(DirectoryNode dir, string name)
{
DocumentInputStream dis = dir.CreateDocumentInputStream(name);
PropertySet set = PropertySetFactory.Create(dis);
return set;
}
示例6: GetDataStream
public override Stream GetDataStream(DirectoryNode dir)
{
DocumentInputStream dr = dir.CreateDocumentInputStream("EncryptedPackage");
long size = dr.ReadLong();
SymmetricAlgorithm cipher=GetCipher();
return new CryptoStream(dr, cipher.CreateDecryptor(cipher.Key, cipher.IV), CryptoStreamMode.Read);
}
示例7: CreateFromEmbeddedOleObject
/// <summary>
/// Creates an instance of this class from an embedded OLE Object. The OLE Object is expected
/// to include a stream "{01}Ole10Native" which contains the actual
/// data relevant for this class.
/// </summary>
/// <param name="directory">directory POI Filesystem object</param>
/// <returns>Returns an instance of this class</returns>
public static Ole10Native CreateFromEmbeddedOleObject(DirectoryNode directory)
{
DocumentEntry nativeEntry =
(DocumentEntry)directory.GetEntry(OLE10_NATIVE);
byte[] data = new byte[nativeEntry.Size];
directory.CreateDocumentInputStream(nativeEntry).Read(data);
return new Ole10Native(data, 0);
}
示例8: GetDataStream
public override Stream GetDataStream(DirectoryNode dir)
{
DocumentInputStream dr = dir.CreateDocumentInputStream("EncryptedPackage");
long size = dr.ReadLong();
return new ChunkedCipherInputStream(dr, size, this);
}