mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 09:31:22 -05:00
Add comment distinguishing Deno.Buffer from Node's Buffer (#4847)
This commit is contained in:
parent
08936c2efc
commit
da6819a14c
1 changed files with 11 additions and 0 deletions
11
cli/js/lib.deno.ns.d.ts
vendored
11
cli/js/lib.deno.ns.d.ts
vendored
|
@ -873,6 +873,17 @@ declare namespace Deno {
|
|||
export function setRaw(rid: number, mode: boolean): void;
|
||||
|
||||
/** A variable-sized buffer of bytes with `read()` and `write()` methods.
|
||||
*
|
||||
* Deno.Buffer is almost always used with some I/O like files and sockets. It
|
||||
* allows one to buffer up a download from a socket. Buffer grows and shrinks
|
||||
* as necessary.
|
||||
*
|
||||
* Deno.Buffer is NOT the same thing as Node's Buffer. Node's Buffer was
|
||||
* created in 2009 before JavaScript had the concept of ArrayBuffers. It's
|
||||
* simply a non-standard ArrayBuffer.
|
||||
*
|
||||
* ArrayBuffer is a fixed memory allocation. Deno.Buffer is implemented on top
|
||||
* of ArrayBuffer.
|
||||
*
|
||||
* Based on [Go Buffer](https://golang.org/pkg/bytes/#Buffer). */
|
||||
export class Buffer implements Reader, SyncReader, Writer, SyncWriter {
|
||||
|
|
Loading…
Add table
Reference in a new issue