Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/s3si/deps.ts>io.BufWriter

Export your battles from SplatNet to https://stat.ink
Go to Latest
class io.BufWriter
implements Writer
extends AbstractBufBase
Deprecated
Deprecated

(will be removed after 1.0.0) Use the [Web Streams API]https://developer.mozilla.org/en-US/docs/Web/API/Streams_API instead.

import { io } from "https://deno.land/x/s3si@gui-v0.4.16/deps.ts";
const { BufWriter } = io;

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

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.

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 are copied into the buffer will be flushed to the writer and the remaining bytes are then copied into the now empty buffer.

Static Methods

create(writer: Writer, size?: number): BufWriter

return new BufWriter unless writer is BufWriter