Buffer

actual value class Buffer(source)

A wrapper value class for a Node.js Buffer object.

See also

expect value class Buffer(source)

A wrapper value class for a Node.js Buffer object.

See also

actual value class Buffer(source)

A wrapper value class for a Node.js Buffer object.

See also

Types

Link copied to clipboard
actual object Companion
expect object Companion
actual object Companion

Properties

Link copied to clipboard
actual val length: Number

The length of the underlying Node.js Buffer.

expect val length: Number

The length of the underlying Node.js Buffer.

actual val length: Number

The length of the underlying Node.js Buffer.

Functions

Link copied to clipboard
actual fun fill()

Fills the buffer with 0-byte data.

expect fun fill()

Fills the buffer with 0-byte data.

actual fun fill()

Fills the buffer with 0-byte data.

Link copied to clipboard
inline operator fun Buffer.get(index: Number): Byte

Helper for Buffer.readInt8

Link copied to clipboard
actual fun readInt8(index: Number): Byte

Reads a byte at the given index from the underlying Node.js Buffer.

expect fun readInt8(index: Number): Byte

Reads a byte at the given index from the underlying Node.js Buffer.

actual fun readInt8(index: Number): Byte

Reads a byte at the given index from the underlying Node.js Buffer.

Link copied to clipboard
inline operator fun Buffer.set(index: Number, value: Byte)

Helper for Buffer.writeInt8

Link copied to clipboard
actual fun toUtf8(start: Number, end: Number): String

Converts data from start to end from bytes, to UTF-8 text.

expect fun toUtf8(start: Number = 0, end: Number = this.length): String

Converts data from start to end from bytes, to UTF-8 text.

actual fun toUtf8(start: Number, end: Number): String

Converts data from start to end from bytes, to UTF-8 text.

Link copied to clipboard
fun unwrap(): dynamic

Unwraps the Buffer value class, returning the underlying Node.js Buffer as a dynamic object.

fun unwrap(): JsAny

Unwraps the Buffer value class, returning the underlying Node.js Buffer as a JsAny object.

Link copied to clipboard
actual fun writeInt8(index: Number, value: Byte)

Writes a byte at the given index to the underlying Node.js Buffer.

expect fun writeInt8(index: Number, value: Byte)

Writes a byte at the given index to the underlying Node.js Buffer.

actual fun writeInt8(index: Number, value: Byte)

Writes a byte at the given index to the underlying Node.js Buffer.