Blob Class
An immutable sequence of bytes with a type (https://w3c.github.io/FileAPI/#blob-section). The parts of the constructor are strings (encoded as UTF-8), blobs, byte arrays and ReadOnlyMemory<T> of bytes. A blob can be referenced by a blob: URL (Url.CreateObjectUrl). stream() and textStream() are defined by the WebIDL bindings, with the streams implemented in JavaScript (docs/scripting.md#streams).
public class BlobConstructors
| Name | Description |
|---|---|
| Blob(IReadOnlyList<object>?, BlobPropertyBag?) | Creates a blob from the given parts (strings, blobs or bytes) and options. |
Blob(IReadOnlyList<object>?, BlobPropertyBag?)
Blob.csCreates a blob from the given parts (strings, blobs or bytes) and options.
public Blob(IReadOnlyList<object>? blobParts = null, BlobPropertyBag? options = null)Properties
| Name | Description |
|---|---|
| Size | Gets the size of the blob, in bytes. |
| Type | Gets the media type of the blob, or an empty string when it is unknown. |
Size
Blob.csGets the size of the blob, in bytes.
public ulong Size { get; }Type
Blob.csGets the media type of the blob, or an empty string when it is unknown.
public string Type { get; }Methods
| Name | Description |
|---|---|
| ArrayBuffer() | Returns a copy of the content (an ArrayBuffer in JavaScript, https://w3c.github.io/FileAPI/#arraybuffer-method-algo). |
| Bytes() | Returns a copy of the content (a Uint8Array in JavaScript, https://w3c.github.io/FileAPI/#bytes-method-algo). |
| Slice(long?, long?, string?) | https://w3c.github.io/FileAPI/#dfn-slice |
| Text() | Returns the content decoded as UTF-8, without the byte order mark (https://w3c.github.io/FileAPI/#text-method-algo). |
ArrayBuffer()
Blob.csReturns a copy of the content (an ArrayBuffer in JavaScript, https://w3c.github.io/FileAPI/#arraybuffer-method-algo).
Bytes()
Blob.csReturns a copy of the content (a Uint8Array in JavaScript, https://w3c.github.io/FileAPI/#bytes-method-algo).
Slice(long?, long?, string?)
Blob.csText()
Blob.csReturns the content decoded as UTF-8, without the byte order mark (https://w3c.github.io/FileAPI/#text-method-algo).