public NPOIFSDocument(string name, int size, NPOIFSFileSystem filesystem, POIFSWriterListener Writer) { _filesystem = filesystem; if (size < POIFSConstants.BIG_BLOCK_MINIMUM_DOCUMENT_SIZE) { _stream = new NPOIFSStream(filesystem.GetMiniStore()); _block_size = _filesystem.GetMiniStore().GetBlockStoreBlockSize(); } else { _stream = new NPOIFSStream(filesystem); _block_size = _filesystem.GetBlockStoreBlockSize(); } Stream innerOs = _stream.GetOutputStream(); DocumentOutputStream os = new DocumentOutputStream(innerOs, size); POIFSDocumentPath path = new POIFSDocumentPath(name.Split(new string[] { "\\\\" }, StringSplitOptions.RemoveEmptyEntries)); string docName = path.GetComponent(path.Length - 1); POIFSWriterEvent event1 = new POIFSWriterEvent(os, path, docName, size); Writer.ProcessPOIFSWriterEvent(event1); innerOs.Dispose(); // And build the property for it _property = new DocumentProperty(name, size); _property.StartBlock = (/*setter*/ _stream.GetStartBlock()); }
internal BigBlockStore(POIFSBigBlockSize bigBlockSize, DocumentBlock[] blocks) { this.bigBlockSize = bigBlockSize; bigBlocks = (DocumentBlock[])blocks.Clone(); path = null; name = null; size = -1; writer = null; }
internal BigBlockStore(POIFSBigBlockSize bigBlockSize, POIFSDocumentPath path, string name, int size, POIFSWriterListener writer) { this.bigBlockSize = bigBlockSize; this.bigBlocks = new DocumentBlock[0]; this.path = path; this.name = name; this.size = size; this.writer = writer; }
internal SmallBlockStore(POIFSBigBlockSize bigBlockSize, SmallDocumentBlock[] blocks) { this.bigBlockSize = bigBlockSize; smallBlocks = (SmallDocumentBlock[])blocks.Clone(); this.path = null; this.name = null; this.size = -1; this.writer = null; }
public DocumentEntry CreateDocument(string name, int size, POIFSWriterListener writer) { if (_nFilesSystem != null) { return(CreateDocument(new NPOIFSDocument(name, size, _nFilesSystem, writer))); } else { return(CreateDocument(new POIFSDocument(name, size, _path, writer))); } }
/// <summary> /// Create a new DocumentEntry in the root entry; the data will be /// provided later /// </summary> /// <param name="name">the name of the new DocumentEntry</param> /// <param name="size">the size of the new DocumentEntry</param> /// <param name="writer">the Writer of the new DocumentEntry</param> /// <returns>the new DocumentEntry</returns> public DocumentEntry CreateDocument(String name, int size, /*POIFSWriterEventHandler*/ POIFSWriterListener writer) //Leon { return(this.Root.CreateDocument(name, size, writer)); }
public NPOIFSDocument(String name, int size, NPOIFSFileSystem filesystem, POIFSWriterListener Writer) { this._filesystem = filesystem; if (size < POIFSConstants.BIG_BLOCK_MINIMUM_DOCUMENT_SIZE) { _stream = new NPOIFSStream(filesystem.GetMiniStore()); _block_size = _filesystem.GetMiniStore().GetBlockStoreBlockSize(); } else { _stream = new NPOIFSStream(filesystem); _block_size = _filesystem.GetBlockStoreBlockSize(); } Stream innerOs = _stream.GetOutputStream(); DocumentOutputStream os = new DocumentOutputStream(innerOs, size); POIFSDocumentPath path = new POIFSDocumentPath(name.Split(new string[] { "\\\\" }, StringSplitOptions.RemoveEmptyEntries)); String docName = path.GetComponent(path.Length - 1); POIFSWriterEvent event1 = new POIFSWriterEvent(os, path, docName, size); Writer.ProcessPOIFSWriterEvent(event1); innerOs.Close(); // And build the property for it this._property = new DocumentProperty(name, size); _property.StartBlock = (/*setter*/_stream.GetStartBlock()); }
internal BigBlockStore(POIFSBigBlockSize bigBlockSize, POIFSDocumentPath path, string name, int size, POIFSWriterListener writer) { this.bigBlockSize = bigBlockSize; this.bigBlocks = new DocumentBlock[0]; this.path = path; this.name = name; this.size = size; this.writer = writer; }
public DocumentEntry CreateDocument(string name, int size, POIFSWriterListener writer) { // return CreateDocument(name, size, write); return(CreateDocument(new POIFSDocument(name, size, _path, writer))); }
internal SmallBlockStore(POIFSBigBlockSize bigBlockSize, SmallDocumentBlock[] blocks) { this.bigBlockSize = bigBlockSize; smallBlocks = (SmallDocumentBlock[])blocks.Clone(); this.path = null; this.name = null; this.size = -1; this.writer = null; }
internal BigBlockStore(POIFSBigBlockSize bigBlockSize, DocumentBlock[] blocks) { this.bigBlockSize = bigBlockSize; bigBlocks = (DocumentBlock[])blocks.Clone(); path = null; name = null; size = -1; writer = null; }
public POIFSDocument(string name, int size, POIFSBigBlockSize bigBlockSize, POIFSDocumentPath path, POIFSWriterListener writer) { _size = size; _bigBigBlockSize = bigBlockSize; _property = new DocumentProperty(name, _size); _property.Document = this; if (_property.ShouldUseSmallBlocks) { _small_store = new SmallBlockStore(_bigBigBlockSize, path, name, size, writer); _big_store = new BigBlockStore(_bigBigBlockSize, EMPTY_BIG_BLOCK_ARRAY); } else { _small_store = new SmallBlockStore(_bigBigBlockSize, EMPTY_SMALL_BLOCK_ARRAY); _big_store = new BigBlockStore(_bigBigBlockSize, path, name, size, writer); } }
public POIFSDocument(string name, int size, POIFSDocumentPath path, POIFSWriterListener writer) :this(name, size, POIFSConstants.SMALLER_BIG_BLOCK_SIZE_DETAILS, path, writer) { }
/** * create a new DocumentEntry in the root entry; the data will be * provided later * * @param name the name of the new DocumentEntry * @param size the size of the new DocumentEntry * @param Writer the Writer of the new DocumentEntry * * @return the new DocumentEntry * * @exception IOException */ public DocumentEntry CreateDocument(String name, int size, POIFSWriterListener writer) { return Root.CreateDocument(name, size, writer); }
/// <summary> /// Create a new DocumentEntry in the root entry; the data will be /// provided later /// </summary> /// <param name="name">the name of the new DocumentEntry</param> /// <param name="size">the size of the new DocumentEntry</param> /// <param name="writer">the Writer of the new DocumentEntry</param> /// <returns>the new DocumentEntry</returns> public DocumentEntry CreateDocument(String name, int size, /*POIFSWriterEventHandler*/ POIFSWriterListener writer) //Leon { return this.Root.CreateDocument(name, size, writer); }
/** * create a new DocumentEntry in the root entry; the data will be * provided later * * @param name the name of the new DocumentEntry * @param size the size of the new DocumentEntry * @param Writer the Writer of the new DocumentEntry * * @return the new DocumentEntry * * @exception IOException */ public DocumentEntry CreateDocument(String name, int size, POIFSWriterListener writer) { return(Root.CreateDocument(name, size, writer)); }
public POIFSDocument(string name, int size, POIFSBigBlockSize bigBlockSize, POIFSDocumentPath path, POIFSWriterListener writer) { _size = size; _bigBigBlockSize = bigBlockSize; _property = new DocumentProperty(name, _size); _property.Document = this; if (_property.ShouldUseSmallBlocks) { _small_store = new SmallBlockStore(_bigBigBlockSize, path, name, size, writer); _big_store = new BigBlockStore(_bigBigBlockSize, EMPTY_BIG_BLOCK_ARRAY); } else { _small_store = new SmallBlockStore(_bigBigBlockSize, EMPTY_SMALL_BLOCK_ARRAY); _big_store = new BigBlockStore(_bigBigBlockSize, path, name, size, writer); } }
public POIFSDocument(string name, int size, POIFSDocumentPath path, POIFSWriterListener writer) : this(name, size, POIFSConstants.SMALLER_BIG_BLOCK_SIZE_DETAILS, path, writer) { }