예제 #1
0
        private void _SetWriteStream(uint increment)
        {
            if (_innerStream != null)
            {
#if NETCF
                _innerStream.Close();
#else
                _innerStream.Dispose();
#endif
                if (File.Exists(CurrentName))
                {
                    File.Delete(CurrentName);
                }
                File.Move(_currentTempName, CurrentName);
                // Console.WriteLine("ZSS: SWS close ({0})",
                //                   Path.GetFileName(CurrentName));
            }

            if (increment > 0)
            {
                CurrentSegment += increment;
            }

            SharedUtilities.CreateAndOpenUniqueTempFile(_baseDir,
                                                        out _innerStream,
                                                        out _currentTempName);

            // Console.WriteLine("ZSS: SWS open ({0})",
            //                   Path.GetFileName(_currentTempName));

            if (CurrentSegment == 0)
            {
                _innerStream.Write(BitConverter.GetBytes(ZipConstants.SplitArchiveSignature), 0, 4);
            }
        }
 private void _SetWriteStream(uint increment)
 {
     if (this._innerStream != null)
     {
         this._innerStream.Dispose();
         if (File.Exists(this.CurrentName))
         {
             File.Delete(this.CurrentName);
         }
         File.Move(this._currentTempName, this.CurrentName);
     }
     if (increment > 0u)
     {
         this.CurrentSegment += increment;
     }
     SharedUtilities.CreateAndOpenUniqueTempFile(this._baseDir, out this._innerStream, out this._currentTempName);
     if (this.CurrentSegment == 0u)
     {
         this._innerStream.Write(BitConverter.GetBytes(134695760), 0, 4);
     }
 }