ICSharpCode.SharpZipLib.Zip.DiskArchiveStorage.OpenForDirectUpdate C# (CSharp) Method

OpenForDirectUpdate() public method

Return a stream suitable for performing direct updates on the original source.
If the stream is not null this is used as is.
public OpenForDirectUpdate ( Stream stream ) : Stream
stream Stream The current stream.
return Stream
        public override Stream OpenForDirectUpdate(Stream stream) {
            Stream result;
            if ((stream==null)||!stream.CanWrite) {
                if (stream!=null) {
                    stream.Dispose();
                }

                result=new FileStream(fileName_,
                                        FileMode.Open,
                                        FileAccess.ReadWrite);
            } else {
                result=stream;
            }

            return result;
        }