MCPcopy Create free account
hub / github.com/denoland/std / writeSync

Method writeSync

io/buffer.ts:309–312  ·  view source on GitHub ↗

* Writes the given data to the buffer. * * @example Usage * ```ts * import { Buffer } from "@std/io/buffer"; * import { assertEquals } from "@std/assert/equals"; * * const buf = new Buffer(); * const data = new TextEncoder().encode("Hello, world!"); * buf.writeSync(data);

(p: Uint8Array)

Source from the content-addressed store, hash-verified

307 * @returns The number of bytes written.
308 */
309 writeSync(p: Uint8Array): number {
310 const m = this.#grow(p.byteLength);
311 return copy(p, this.#buf, m);
312 }
313
314 /**
315 * Writes the given data to the buffer. Resolves to the number of bytes

Callers 4

writeMethod · 0.95
readFromMethod · 0.95
readFromSyncMethod · 0.95
fnFunction · 0.95

Calls 2

#growMethod · 0.95
copyFunction · 0.90

Tested by

no test coverage detected