Blob

Implements the Blob type from the Node.js buffer built-in module. Blobs are read-only chunks of byte data which can be used to derive buffers, strings, and other objects.

Inheritors

Properties

Link copied to clipboard
abstract val size: Int

Size in bytes of this blob.

Link copied to clipboard
abstract val type: String?

The content type of this Blob. Note that this value is informative only.

Functions

Link copied to clipboard

Returns a promise which resolves with a JavaScript ArrayBuffer object containing a copy of this blob's data.

Link copied to clipboard
abstract fun slice(start: Int? = null, end: Int? = null, type: String? = null): BufferAPI.Blob

Returns a copy of this blob between the requested indices, and optionally with a different type.

Link copied to clipboard
abstract fun stream(): ReadableStream

Returns a stream that can be used to read the contents of this blob.

Link copied to clipboard
abstract fun text(): JsPromise<String>

Returns a promise which resolves with the result of decoding this blob's data as a UTF-8 string.