Classes
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.
- create(): BufWriterwriter: Writer,size?: number
return new BufWriter unless writer is BufWriter
- flush(): Promise<void>
Flush writes any buffered data to the underlying io.Writer.
- reset(w: Writer): void
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
datainto 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.
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.
- create(): BufWriterSyncwriter: WriterSync,size?: number
return new BufWriterSync unless writer is BufWriterSync
- flush(): void
Flush writes any buffered data to the underlying io.WriterSync.
- reset(w: WriterSync): void
Discards any unflushed buffered data, clears any error, and resets buffer to write its output to w.
- writeSync(data: Uint8Array): number
Writes the contents of
datainto 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.