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

Method bytes

io/buffer.ts:90–93  ·  view source on GitHub ↗

* Returns a slice holding the unread portion of the buffer. * * The slice is valid for use only until the next buffer modification (that * is, only until the next call to a method like `read()`, `write()`, * `reset()`, or `truncate()`). If `options.copy` is false the slice aliases the bu

(options = { copy: true })

Source from the content-addressed store, hash-verified

88 * @returns A slice holding the unread portion of the buffer.
89 */
90 bytes(options = { copy: true }): Uint8Array {
91 if (options.copy === false) return this.#buf.subarray(this.#off);
92 return this.#buf.slice(this.#off);
93 }
94
95 /**
96 * Returns whether the unread portion of the buffer is empty.

Calls 1

sliceMethod · 0.45

Tested by

no test coverage detected