private static CopyStream ( Stream inputStream, Stream outputStream, long bytesToCopy, byte buf ) : void | ||
inputStream | Stream | |
outputStream | Stream | |
bytesToCopy | long | |
buf | byte | |
return | void |
private static void CopyStream(Stream inputStream, Stream outputStream, long bytesToCopy, byte[] buf)
{
while (bytesToCopy > 0)
{
int bytesRead = inputStream.Read(buf, 0, Math.Min(bytesToCopy > int.MaxValue ? int.MaxValue : (int)bytesToCopy, buf.Length));
outputStream.Write(buf, 0, bytesRead);
bytesToCopy -= bytesRead;
}
}