diff options
Diffstat (limited to 'std/io/util.ts')
-rw-r--r-- | std/io/util.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/std/io/util.ts b/std/io/util.ts index 18ddb4def..237747a89 100644 --- a/std/io/util.ts +++ b/std/io/util.ts @@ -9,12 +9,12 @@ import { encode } from "../encoding/utf8.ts"; * Copy bytes from one Uint8Array to another. Bytes from `src` which don't fit * into `dst` will not be copied. * - * @param dst Destination byte array * @param src Source byte array + * @param dst Destination byte array * @param off Offset into `dst` at which to begin writing values from `src`. * @return number of bytes copied */ -export function copyBytes(dst: Uint8Array, src: Uint8Array, off = 0): number { +export function copyBytes(src: Uint8Array, dst: Uint8Array, off = 0): number { off = Math.max(0, Math.min(off, dst.byteLength)); const dstBytesAvailable = dst.byteLength - off; if (src.byteLength > dstBytesAvailable) { |