Packages

package buffer

buffer package object

Linear Supertypes
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 Uint8Array

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

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

  2. implicit final class BufferExtensions extends AnyVal

    Buffer Extensions

  3. implicit final class BufferObjExtensions extends AnyVal

    Buffer Extensions

  4. class SlowBuffer extends Buffer

    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. val INSPECT_MAX_BYTES: Int

    Returns the maximum number of bytes that will be returned when buf.inspect() is called.

    Returns the maximum number of bytes that will be returned when buf.inspect() is called. This can be overridden by user modules. See util.inspect() for more details on buf.inspect() behavior.

    Note that this is a property on the buffer module returned by require('buffer'), not on the Buffer global or a Buffer instance.

  2. val kMaxLength: Int

    On 32-bit architectures, this value is (230)-1 (~1GB). On 64-bit architectures, this value is (231)-1 (~2GB).F Note that this is a property on the buffer module returned by require('buffer'), not on the Buffer global or a Buffer instance.

  3. def transcode(source: Uint8Array, fromEnc: String, toEnc: String): Buffer

    Re-encodes the given Buffer or Uint8Array instance from one character encoding to another.

    Re-encodes the given Buffer or Uint8Array instance from one character encoding to another. Returns a new Buffer instance.

    Throws if the fromEnc or toEnc specify invalid character encodings or if conversion from fromEnc to toEnc is not permitted.

    Encodings supported by buffer.transcode() are: 'ascii', 'utf8', 'utf16le', 'ucs2', 'latin1', and 'binary'.

    The transcoding process will use substitution characters if a given byte sequence cannot be adequately represented in the target encoding.

    source

    A Buffer instance

    fromEnc

    The current encoding

    toEnc

    To target encoding

    returns

    a new Buffer instance.

    See also

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

  4. object Buffer extends Object
    Annotations
    @native() @JSGlobal()
  5. object constants extends Object
    Annotations
    @native() @JSImport( "buffer" , "constants" )

Inherited from AnyRef

Inherited from Any

Ungrouped