Skip to main content

@std/io@0.215.0

latest
Works with
It is unknown whether this package works with Browsers, Deno, Node.js, Cloudflare Workers, Bun
It is unknown whether this package works with Browsers
It is unknown whether this package works with Deno
It is unknown whether this package works with Node.js
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Bun
JSR Score70%
Published2 years ago (0.215.0)
class BufWriter
implements Writer
extends AbstractBufBase
Deprecated

(will be removed after 1.0.0) Use the Web Streams API instead.

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
)

Static Methods

return new BufWriter unless writer is BufWriter

Methods

Flush writes any buffered data to the underlying io.Writer.

Discards any unflushed buffered data, clears any error, and resets buffer to write its output to w.

Writes the contents of data into the buffer. If the contents won't fully fit into the buffer, those bytes that are copied into the buffer will be flushed to the writer and the remaining bytes are then copied into the now empty buffer.

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@std/io

Import symbol

import { BufWriter } from "@std/io";
or

Import directly with a jsr specifier

import { BufWriter } from "jsr:@std/io";