Package

io.scalajs.nodejs

buffer

Permalink

package buffer

buffer package object

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. buffer
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class Buffer extends Object

    Permalink

    Prior to the introduction of TypedArray in ECMAScript 2015 (ES6), the JavaScript language had no mechanism for reading or manipulating streams of binary data.

    Prior to the introduction of TypedArray in ECMAScript 2015 (ES6), the JavaScript language had no mechanism for reading or manipulating streams of binary data. The Buffer class was introduced as part of the Node.js API to make it possible to interact with octet streams in the context of things like TCP streams and file system operations.

    Now that TypedArray has been added in ES6, the Buffer class implements the Uint8Array API in a manner that is more optimized and suitable for Node.js' use cases.

    Instances of the Buffer class are similar to arrays of integers but correspond to fixed-sized, raw memory allocations outside the V8 heap. The size of the Buffer is established when it is created and cannot be resized.

    The Buffer class is a global within Node.js, making it unlikely that one would need to ever use require('buffer').

    Annotations
    @RawJSType() @native() @JSImport( "buffer" , "Buffer" )
    See also

    https://nodejs.org/api/buffer.html

  2. implicit final class BufferExtensions extends AnyVal

    Permalink

    Buffer Extensions

  3. class SlowBuffer extends Buffer

    Permalink

    Returns an un-pooled Buffer.

    Returns an un-pooled Buffer.

    In order to avoid the garbage collection overhead of creating many individually allocated Buffer instances, by default allocations under 4KB are sliced from a single larger allocated object. This approach improves both performance and memory usage since v8 does not need to track and cleanup as many Persistent objects.

    In the case where a developer may need to retain a small chunk of memory from a pool for an indeterminate amount of time, it may be appropriate to create an un-pooled Buffer instance using SlowBuffer then copy out the relevant bits.

    Annotations
    @RawJSType() @deprecated @native() @JSImport( "buffer" , "SlowBuffer" )
    Deprecated

    (Since version 6.0.0) Use Buffer.allocUnsafeSlow() instead.

    See also

    https://nodejs.org/api/buffer.html#buffer_class_slowbuffer

Value Members

  1. object Buffer extends Object

    Permalink
    Annotations
    @native() @JSName( "Buffer" )

Inherited from AnyRef

Inherited from Any

Ungrouped