Function writeAllSync

  • Synchronously write all the content of the array buffer (arr) to the writer (w).

    Parameters

    • writer: WriterSync

      The writer to write to

    • data: Uint8Array

      The data to write

    Returns void

    import { writeAllSync } from "@std/io/write-all";

    const contentBytes = new TextEncoder().encode("Hello World");
    writeAllSync(Deno.stdout, contentBytes);
    import { writeAllSync } from "@std/io/write-all";

    const contentBytes = new TextEncoder().encode("Hello World");
    using file = Deno.openSync("test.file", { write: true });
    writeAllSync(file, contentBytes);