Add buffer size argument to copy (#4907)

This commit is contained in:
Marcos Casagrande 2020-04-26 22:25:24 +02:00 committed by GitHub
parent f7d1f82796
commit 26dfd3c110
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 75 additions and 3 deletions

View file

@ -572,8 +572,15 @@ declare namespace Deno {
*
* @param src The source to copy from
* @param dst The destination to copy to
* @param options Can be used to tune size of the buffer. Default size is 32kB
*/
export function copy(src: Reader, dst: Writer): Promise<number>;
export function copy(
src: Reader,
dst: Writer,
options?: {
bufSize?: number;
}
): Promise<number>;
/** Turns a Reader, `r`, into an async iterator.
*