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 BufWriterSync
implements WriterSync
Deprecated

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

BufWriterSync implements buffering for a deno.WriterSync object. If an error occurs writing to a WriterSync, 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.WriterSync.

Constructors

new BufWriterSync(
writer: WriterSync,
size?: number
)

Static Methods

return new BufWriterSync unless writer is BufWriterSync

Methods

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

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 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.

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 { BufWriterSync } from "@std/io/buf_writer";
or

Import directly with a jsr specifier

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