import { copy } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/bytes/index.js";
Copies bytes from src
array to dest
and returns the number of bytes copied.
Examples
Example 1
Example 1
import { copy } from "@ayonli/jsext/bytes";
const src = new Uint8Array([1, 2, 3, 4, 5]);
const dest = new Uint8Array(3);
const n = copy(src, dest);
console.log(n); // 3
console.log(dest); // Uint8Array(3) [ 1, 2, 3 ]