class BufWriter
implements Writer
extends AbstractBufBase
import { BufWriter } from "https://dotland.deno.dev/std@0.119.0/io/buffer.ts";
BufWriter implements buffering for an deno.Writer object. If an error occurs writing to a Writer, no more data will be accepted and all subsequent writes, and flush(), will return the error. After all data has been written, the client should call the flush() method to guarantee all data has been forwarded to the underlying deno.Writer.
Constructors
new
BufWriter(writer: Writer, size?: number)Methods
write(data: Uint8Array): Promise<number>
Writes the contents of data
into the buffer. If the contents won't fully
fit into the buffer, those bytes that can are copied into the buffer, the
buffer is the flushed to the writer and the remaining bytes are copied into
the now empty buffer.