Exemplo n.º 1
0
        /// <summary>
        /// Method to open an existing storage file
        /// </summary>
        /// <param name="_filename">Full path of Zip file to open</param>
        /// <param name="_access">File access mode as used in FileStream constructor</param>
        /// <returns>A valid ZipStorer object</returns>
        public static ZipStorerLight Open(string _filename)
        {
            Stream stream = (Stream) new FileStream(_filename, FileMode.Open, FileAccess.Read);

            ZipStorerLight zip = Open(stream);

            zip.FileName = _filename;

            return(zip);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Method to open an existing storage from stream
        /// </summary>
        /// <param name="_stream">Already opened stream with zip contents</param>
        /// <param name="_access">File access mode for stream operations</param>
        /// <returns>A valid ZipStorer object</returns>
        public static ZipStorerLight Open(Stream _stream)
        {
            ZipStorerLight zip = new ZipStorerLight();

            //zip.FileName = _filename;
            zip.ZipFileStream = _stream;

            if (zip.ReadFileInfo())
            {
                return(zip);
            }

            throw new System.IO.InvalidDataException();
        }