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

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): Buffer
  5. def alloc(size: Int, fill: Int): Buffer
  6. def alloc(size: Int, fill: Uint8Array): Buffer
  7. def alloc(size: Int, fill: String): Buffer
  8. def alloc(size: Int, fill: String, encoding: String): 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

  9. 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

  10. 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

  11. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  12. def byteLength(string: ArrayBuffer): Int
  13. def byteLength(string: DataView): Int
  14. def byteLength(string: TypedArray[_, _]): Int
  15. def byteLength(string: String): Int
  16. def byteLength(string: String, encoding: String): 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

  17. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  18. 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

  19. def concat[B <: Uint8Array](list: Array[B]): Buffer
  20. def concat[B <: Uint8Array](list: Array[B], totalLength: Int): 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

  21. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  23. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  24. 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

  25. 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

  26. 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

  27. 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

  28. def from(arrayBuffer: ArrayBuffer): Buffer
  29. def from(arrayBuffer: ArrayBuffer, byteOffset: Int): Buffer
  30. def from(arrayBuffer: ArrayBuffer, byteOffset: Int, length: Int): 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

  31. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  32. def hasOwnProperty(v: String): Boolean
    Definition Classes
    Object
  33. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  34. 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

  35. 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

  36. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  37. def isPrototypeOf(v: Object): Boolean
    Definition Classes
    Object
  38. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  39. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  40. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  41. 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.

  42. def propertyIsEnumerable(v: String): Boolean
    Definition Classes
    Object
  43. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  44. def toLocaleString(): String
    Definition Classes
    Object
  45. def toString(): String
    Definition Classes
    AnyRef → Any
  46. def valueOf(): Any
    Definition Classes
    Object
  47. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  48. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  49. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped