class Blob

Supported only in the v8 engine. Introduced in Max v9.2.0.

An immutable blob of binary data with a MIME type.

Index

Constructors

Properties

Methods

new Blob(parts, options)

new Blob(
  parts?: Array<string | ArrayBuffer | ArrayBufferView | Blob>,
  options?: { type?: string },
);

Constructs a new instance of the Blob class

ParameterTypeDescription
optional partsArray<string | ArrayBuffer | ArrayBufferView | Blob>the data parts that make up the blob.
optional optionsobjectblob options; type sets the MIME type.
optional options.type string

arrayBuffer()

Reads the blob contents as an ArrayBuffer.

arrayBuffer(): Promise<ArrayBuffer>;
NameTypeDescription
Return ValuePromise<ArrayBuffer>

bytes()

Reads the blob contents as bytes.

bytes(): Promise<buffer.IOBuffer>;
NameTypeDescription
Return ValuePromise<buffer.IOBuffer>

size number read-only

Size of the blob in bytes.

slice(start, end, contentType)

Returns a new blob containing a byte range of this blob.

slice(start?: number, end?: number, contentType?: string): Blob;
NameTypeDescription
optional startnumberstart byte offset
optional endnumberend byte offset (exclusive)
optional contentTypestringMIME type for the new blob
Return ValueBlob

stream()

Returns a byte-oriented ReadableStream over the blob contents.

stream(): ReadableStream;
NameTypeDescription
Return ValueReadableStream

text()

Reads the blob contents as a UTF-8 string.

text(): Promise<string>;
NameTypeDescription
Return ValuePromise<string>

type string read-only

MIME type of the blob, or "".