public static CopyTo ( this input, Stream output, int bufferSize, int bytes ) : void | ||
input | this | |
output | Stream | |
bufferSize | int | |
bytes | int | |
return | void |
public static void CopyTo(this Stream input, Stream output, int bufferSize, int bytes) {
byte[] buffer = new byte[bufferSize];
int read;
while (bytes > 0 && (read = input.Read(buffer, 0, Math.Min(buffer.Length, bytes))) > 0) {
output.Write(buffer, 0, read);
bytes -= read;
}
}
}