I have a situation where I need to transfer Zip file(Around 10 GB) from one server to another. Now there are two ways, one is using read stream and write stream -
while (inputZip.Length > nAmountWritten)
{
buffer = reader.ReadBytes(10 * 1024 * 1024);
bw.Write(buffer); //Binary Writer for destination
nAmountWritten += buffer.Length;
}
Another is File.Copy
.
Which way is better for transferring big files. Is it okay if I use File.Copy in such kind of scenario?
In on situation, I faced in Read And Write way is that sometime one chunk gets corrupted resulting in getting few files corrupted in Zip.