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

Method bytes

streams/buffer.ts:195–198  ·  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 that mutates or consumes the * buffer, like reading data out via `readable`, `reset()`, or `truncate()`).

(options: BufferBytesOptions = { copy: true })

Source from the content-addressed store, hash-verified

193 * ```
194 */
195 bytes(options: BufferBytesOptions = { copy: true }): Uint8Array {
196 if (options.copy === false) return this.#buf.subarray(this.#off);
197 return this.#buf.slice(this.#off);
198 }
199
200 /**
201 * Returns whether the unread portion of the buffer is empty.

Callers 3

buffer_test.tsFile · 0.45
toBytesFunction · 0.45

Calls 1

sliceMethod · 0.45

Tested by

no test coverage detected