BufferClass
Provides the prototype for the Node.js Buffer
type, and acts as a meta-object for it, allowing the creation of new instances via "static" methods. A single instance of this class should be injected into a guest context to act as the Buffer
symbol itself.
Properties
Functions
Allocate a new buffer of the given size without initializing it. The returned buffer contains arbitrary values and must be manually zeroed out.
Allocate a new buffer of the given size without initializing it. The returned buffer contains arbitrary values and must be manually zeroed out.
Compare two instances of Buffer or UInt8Array.
Allocate a new buffer and fill it by concatenating the data from a list of values (either Buffer or Uint8Array instances), up to totalLength if specified.
Allocate a new buffer and fill it using the data from the given source. The source may be a simple integer[]
array, Buffer or UInt8Array instance, in which case other parameters are ignored; an ArrayBuffer
or SharedArrayBuffer
, which allow setting an offset and length for the data to copy; or a string, which is converted to bytes using the encoding.
Returns whether a given object is a Buffer instance.
Returns whether a given string represents a valid encoding supported by the runtime.