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
| Parameter | Type | Description |
|---|---|---|
| optional parts | Array<string | ArrayBuffer | ArrayBufferView | Blob> | the data parts that make up the blob. |
| optional options | object | blob options; type sets the MIME type.optional options.type string |
arrayBuffer()
Reads the blob contents as an ArrayBuffer.
arrayBuffer(): Promise<ArrayBuffer>;
| Name | Type | Description |
|---|---|---|
| Return Value | Promise<ArrayBuffer> |
bytes()
Reads the blob contents as bytes.
bytes(): Promise<buffer.IOBuffer>;
| Name | Type | Description |
|---|---|---|
| Return Value | Promise<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;
| Name | Type | Description |
|---|---|---|
| optional start | number | start byte offset |
| optional end | number | end byte offset (exclusive) |
| optional contentType | string | MIME type for the new blob |
| Return Value | Blob |
stream()
Returns a byte-oriented ReadableStream over the blob contents.
stream(): ReadableStream;
| Name | Type | Description |
|---|---|---|
| Return Value | ReadableStream |
text()
Reads the blob contents as a UTF-8 string.
text(): Promise<string>;
| Name | Type | Description |
|---|---|---|
| Return Value | Promise<string> |
type string read-only
MIME type of the blob, or "".