System.IO.Compression.ZipStorer.Open C# (CSharp) Méthode

Open() public static méthode

Method to open an existing storage from stream
public static Open ( System.Stream _stream, FileAccess _access ) : ZipStorer
_stream System.Stream Already opened stream with zip contents
_access FileAccess File access mode for stream operations
Résultat ZipStorer
        public static ZipStorer Open(Stream _stream, FileAccess _access)
        {
            if (!_stream.CanSeek && _access != FileAccess.Read)
                throw new InvalidOperationException("Stream cannot seek");

            ZipStorer zip = new ZipStorer();
            //zip.FileName = _filename;
            zip.ZipFileStream = _stream;
            zip.Access = _access;

            if (zip.ReadFileInfo())
                return zip;

            throw new System.IO.InvalidDataException();
        }

Same methods

ZipStorer::Open ( string _filename, FileAccess _access ) : ZipStorer