CSharpUtils.VirtualFileSystem.FileSystem.ReplaceFileWithStream C# (CSharp) Метод

ReplaceFileWithStream() публичный Метод

public ReplaceFileWithStream ( String Path, Stream NewStream, long>.Action Progress = null ) : void
Path String
NewStream Stream
Progress long>.Action
Результат void
		public void ReplaceFileWithStream(String Path, Stream NewStream, Action<long, long> Progress = null)
		{
            if (Progress == null) Progress = (_Current, _Total) => { };

			this.OpenFileRWScope(Path, (OldStream) =>
			{
                OldStream.WriteStream(NewStream, (Current, Total) =>
                {
                    Progress(Current, OldStream.Length);
                });
                long Waypoint = OldStream.Position;
                OldStream.WriteByteRepeatedTo(0x00, OldStream.Length, (Current, Total) =>
                {
                    Progress(Waypoint + Current, OldStream.Length);
                });
			});
			
		}