示例#1
0
        /// <summary>
        /// Creates an instance of this class from an embedded OLE Object. The OLE Object is expected
        /// to include a stream &quot;{01}Ole10Native&quot; 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));
        }
示例#2
0
 /**
  * open a document in the root entry's list of entries
  *
  * @param documentName the name of the document to be opened
  *
  * @return a newly opened DocumentInputStream
  *
  * @exception IOException if the document does not exist or the
  *            name is that of a DirectoryEntry
  */
 public DocumentInputStream CreateDocumentInputStream(string documentName)
 {
     return(Root.CreateDocumentInputStream(documentName));
 }