Exemplo n.º 1
0
 internal CMFEditor(CMFArchive archive, string tempfolder, CompressionLevel compression)
 {
     this._issaving        = false;
     this.myArchive        = archive;
     this.CompressionLevel = compression;
     this.TemporaryFolder  = tempfolder;
     this.myultimatebuffer = new byte[4096];
     this.datadictionary   = new Dictionary <CMFEntry, FileStream>();
 }
Exemplo n.º 2
0
 internal EntriesWalker(CMFArchive archive)
 {
     this.myEntry       = null;
     this.sourceArchive = archive;
     this.currentCount  = 0;
     this.buffer        = new byte[CmfFormat.FileHeaderSize];
     this.currentPos    = this.sourceArchive.headeroffsetStart;
     this.br            = new BinaryReader(this.sourceArchive.BaseStream);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Read CMF file from stream.
        /// </summary>
        /// <param name="stream">Content Stream</param>
        /// <param name="leaveOpen">Determine if the stream will be closed when <see cref="CMFArchive"/> is closed.</param>
        /// <returns></returns>
        public static CMFArchive Read(Stream stream, bool leaveOpen)
        {
            if (!stream.CanRead)
            {
                throw new InvalidOperationException("The stream should be readable.");
            }
            CMFArchive result = new CMFArchive(stream, leaveOpen);

            result.ReadHeader();
            return(result);
        }
Exemplo n.º 4
0
 internal CMFReader(CMFArchive archive)
 {
     this.sourceArchive   = archive;
     this.dataoffsetStart = archive.dataoffsetStart;
     if (archive.entrylist == null)
     {
         this.entryWalker = new EntriesWalker(archive);
     }
     else
     {
         this.entryWalker = archive.Entries.GetEnumerator();
     }
 }