object Buffer extends Object
- Annotations
- @native() @JSGlobal()
- Alphabetic
- By Inheritance
- Buffer
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def alloc(size: Int, fill: |[|[Uint8Array, Int], String] = js.native, encoding: String = js.native): Buffer
Allocates a new
Bufferofsizebytes.Allocates a new
Bufferofsizebytes. Iffillisundefined, theBufferwill be zero-filled.- size
The desired length of the new
Buffer- fill
A value to pre-fill the new
Bufferwith. Default:0- encoding
If fill
is a string, this is its encoding. Default:'utf8'
- def allocUnsafe(size: Int): Buffer
Allocates a new
Bufferofsizebytes.Allocates a new
Bufferofsizebytes. Ifsizeis larger than constants.MAX_LENGTH or smaller than0,ERR_INVALID_OPT_VALUEis thrown. A zero-lengthBufferis created if size is0.- size
The desired length of the new
Buffer.
- def allocUnsafeSlow(size: Int): Buffer
Allocates a new
Bufferofsizebytes.Allocates a new
Bufferofsizebytes. Ifsizeis larger than constants.MAX_LENGTH or smaller than0,ERR_INVALID_OPT_VALUEis thrown. A zero-lengthBufferis created if size is0.- size
The desired length of the new
Buffer.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- 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.lengthsince 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'.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def compare(buf1: Uint8Array, buf2: Uint8Array): Int
Compares
buf1tobuf2typically for the purpose of sorting arrays ofBufferinstances.Compares
buf1tobuf2typically for the purpose of sorting arrays ofBufferinstances. This is equivalent to callingbuf1.compare(buf2). - def concat(list: |[Array[Buffer], Array[Uint8Array]], totalLength: Int = js.native): Buffer
Returns a new
Bufferwhich is the result of concatenating all theBuffers in thelisttogether.Returns a new
Bufferwhich is the result of concatenating all theBuffers in thelisttogether.- list
List of Buffer or Uint8Array instances to concat.
- totalLength
Total length of the
Bufferinstances inlistwhen concatenated.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def from(str: String): Buffer
Creates a new
Buffercontainingstring.Creates a new
Buffercontainingstring. UTF-8 encoding is used.- str
A string to encode.
- def from(str: String, encoding: String): Buffer
Creates a new
Buffercontainingstring.Creates a new
Buffercontainingstring. Theencodingparameter identifies the character encoding ofstring.- str
A string to encode.
- encoding
The encoding of string. Default: 'utf8'.
- def from(array: Array[Int]): Buffer
Allocates a new
Bufferusing anarrayof octets.Allocates a new
Bufferusing anarrayof octets. - def from(buffer: Uint8Array): Buffer
Copies the passed
bufferdata onto a newBufferinstance.Copies the passed
bufferdata onto a newBufferinstance.- buffer
An existing Buffer or Uint8Array from which to copy data.
- 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.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def isBuffer(obj: Object): Boolean
Returns
trueifobjis aBuffer,falseotherwise.Returns
trueifobjis aBuffer,falseotherwise.- obj
the given object
- def isEncoding(encoding: String): Boolean
Returns true if
encodingcontains a supported character encoding, or false otherwise.Returns true if
encodingcontains a supported character encoding, or false otherwise. - final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- 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.
- def propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toLocaleString(): String
- Definition Classes
- Object
- def toString(): String
- Definition Classes
- AnyRef → Any
- def valueOf(): Any
- Definition Classes
- Object
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])