Packages

object Buffer extends Object

Annotations
@native() @JSGlobal()
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Buffer
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. type UnsafeBigInt = Dynamic

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def alloc(size: Int, fill: |[|[Uint8Array, Int], String] = js.native, encoding: String = js.native): Buffer

    Allocates a new Buffer of size bytes.

    Allocates a new Buffer of size bytes. If fill is undefined, the Buffer will be zero-filled.

    size

    The desired length of the new Buffer

    fill

    A value to pre-fill the new Buffer with. Default: 0

    encoding

    If fill is a string, this is its encoding. Default: 'utf8'

    See also

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

  5. def allocUnsafe(size: Int): Buffer

    Allocates a new Buffer of size bytes.

    Allocates a new Buffer of size bytes. If size is larger than constants.MAX_LENGTH or smaller than 0, ERR_INVALID_OPT_VALUE is thrown. A zero-length Buffer is created if size is 0.

    size

    The desired length of the new Buffer.

    See also

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

  6. def allocUnsafeSlow(size: Int): Buffer

    Allocates a new Buffer of size bytes.

    Allocates a new Buffer of size bytes. If size is larger than constants.MAX_LENGTH or smaller than 0, ERR_INVALID_OPT_VALUE is thrown. A zero-length Buffer is created if size is 0.

    size

    The desired length of the new Buffer.

    See also

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

  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def byteLength(string: |[|[|[String, TypedArray[_, _]], DataView], ArrayBuffer], encoding: String = "utf8"): Int

    Returns the actual byte length of a string.

    Returns the actual byte length of a string. This is not the same as String.prototype.length since that returns the number of characters in a string.

    string

    A value to calculate the length of.

    encoding

    If string is a string, this is its encoding. Default: 'utf8'.

    See also

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

  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  10. def compare(buf1: Uint8Array, buf2: Uint8Array): Int

    Compares buf1 to buf2 typically for the purpose of sorting arrays of Buffer instances.

    Compares buf1 to buf2 typically for the purpose of sorting arrays of Buffer instances. This is equivalent to calling buf1.compare(buf2).

    See also

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

  11. def concat(list: |[Array[Buffer], Array[Uint8Array]], totalLength: Int = js.native): Buffer

    Returns a new Buffer which is the result of concatenating all the Buffers in the list together.

    Returns a new Buffer which is the result of concatenating all the Buffers in the list together.

    list

    List of Buffer or Uint8Array instances to concat.

    totalLength

    Total length of the Buffer instances in list when concatenated.

    See also

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

  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. def from(str: String): Buffer

    Creates a new Buffer containing string.

    Creates a new Buffer containing string. UTF-8 encoding is used.

    str

    A string to encode.

    See also

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

  15. def from(str: String, encoding: String): Buffer

    Creates a new Buffer containing string.

    Creates a new Buffer containing string. The encoding parameter identifies the character encoding of string.

    str

    A string to encode.

    encoding

    The encoding of string. Default: 'utf8'.

    See also

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

  16. def from(array: Array[Int]): Buffer

    Allocates a new Buffer using an array of octets.

    Allocates a new Buffer using an array of octets.

    See also

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

  17. def from(buffer: Uint8Array): Buffer

    Copies the passed buffer data onto a new Buffer instance.

    Copies the passed buffer data onto a new Buffer instance.

    buffer

    An existing Buffer or Uint8Array from which to copy data.

    See also

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

  18. def from(arrayBuffer: ArrayBuffer, byteOffset: Int = js.native, length: Int = js.native): Buffer

    When passed a reference to the .buffer property of a TypedArray instance, the newly created Buffer will share the same allocated memory as the TypedArray.

    When passed a reference to the .buffer property of a TypedArray instance, the newly created Buffer will share the same allocated memory as the TypedArray.

    See also

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

  19. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  20. def hasOwnProperty(v: String): Boolean
    Definition Classes
    Object
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  22. def isBuffer(obj: Object): Boolean

    Returns true if obj is a Buffer, false otherwise.

    Returns true if obj is a Buffer, false otherwise.

    obj

    the given object

    See also

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

  23. def isEncoding(encoding: String): Boolean

    Returns true if encoding contains a supported character encoding, or false otherwise.

    Returns true if encoding contains a supported character encoding, or false otherwise.

    See also

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

  24. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  25. def isPrototypeOf(v: Object): Boolean
    Definition Classes
    Object
  26. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  28. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  29. var poolSize: Int

    This is the number of bytes used to determine the size of pre-allocated, internal Buffer instances used for pooling.

    This is the number of bytes used to determine the size of pre-allocated, internal Buffer instances used for pooling. This value may be modified.

  30. def propertyIsEnumerable(v: String): Boolean
    Definition Classes
    Object
  31. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  32. def toLocaleString(): String
    Definition Classes
    Object
  33. def toString(): String
    Definition Classes
    AnyRef → Any
  34. def valueOf(): Any
    Definition Classes
    Object
  35. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  36. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  37. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped