0
0
Fork 0
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:
Ryan Dahl 2020-04-22 14:26:16 -04:00 committed by GitHub
parent 08936c2efc
commit da6819a14c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 {