Exemplo n.º 1
0
        private void NewVolumeStream()
        {
            CurrentStream++;
            string newVolumeName = null;
            int    p             = _archiveName.LastIndexOf(".");

            if (p >= 0 && _altNames && (p + 1) == _archiveName.Length - 3)
            {
                if (CurrentStream == 0)
                {
                    newVolumeName = _archiveName;
                }
                else
                {
                    newVolumeName = _archiveName.Substring(0, p + 1) + (CurrentStream > 9 ? (CurrentStream > 99 ? CurrentStream.ToString() : "0" + CurrentStream) : "00" + CurrentStream);
                }
            }
            else
            {
                newVolumeName = _archiveName + VolumeNumber(CurrentStream + 1);
            }
            Streams.Add(File.Create(newVolumeName));
            Streams[CurrentStream].SetLength(_volumeSize);
            StreamOffsets.Add(CurrentStream, new KeyValuePair <long, long>(0, _volumeSize - 1));
        }