Exemple #1
0
 private void NewVolumeStream()
 {
     ++this.CurrentStream;
     this.Streams.Add((Stream)File.Create(this._ArchiveName + MultiStreamWrapper.VolumeNumber(this.CurrentStream + 1)));
     this.Streams[this.CurrentStream].SetLength((long)this._VolumeSize);
     this.StreamOffsets.Add(this.CurrentStream, new KeyValuePair <long, long>(0L, (long)(this._VolumeSize - 1)));
 }
Exemple #2
0
        public InMultiStreamWrapper(string fileName, bool dispose)
            : base(dispose)
        {
            string str   = fileName.Substring(0, fileName.Length - 4);
            int    index = 0;

            for (; File.Exists(fileName); fileName = str + MultiStreamWrapper.VolumeNumber(index + 1))
            {
                this.Streams.Add((Stream) new FileStream(fileName, FileMode.Open));
                long length = this.Streams[index].Length;
                this.StreamOffsets.Add(index++, new KeyValuePair <long, long>(this.StreamLength, this.StreamLength + length));
                this.StreamLength += length;
            }
        }