public override void Write(byte[] buffer, int offset, int count)
        {
            long diff = _bytesWrote + count - _files[_currFileId].Size;

            if (diff > 0)
            {
                var zbuffer = new byte[count - diff];
                Array.Copy(buffer, 0, zbuffer, 0, count - diff);
                long zcount = count;

                _uploadStream.Write(zbuffer, offset, (int)(zcount - diff));

                NextFile();
            }

            long ncount  = diff <= 0 ? count : diff;
            var  nbuffer = new byte[ncount];

            Array.Copy(buffer, count - ncount, nbuffer, 0, ncount);

            _bytesWrote += ncount;

            _uploadStream.Write(nbuffer, offset, (int)ncount);
        }
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);
            if (!disposing)
            {
                return;
            }

            _uploadStream?.Close();

            if (_files.Count > 1)
            {
                string content = $"filename={_origfile.Name}\r\nsize = {_origfile.Size.DefaultValue}";
                var    data    = Encoding.UTF8.GetBytes(content);
                using (var stream = new UploadStream(_origfile.FullPath, _cloud, data.Length))
                {
                    stream.Write(data, 0, data.Length);
                }
            }

            OnFileUploaded(_files);
        }