MetadataBlob Class
An immutable sequence of metadata bytes (EXIF, XMP, ICC...).
public sealed class MetadataBlob : IEquatable<MetadataBlob>Remarks
The constructor copies its input, so the caller cannot mutate the blob afterward. Because blobs are immutable, metadata clones share them instead of copying them. Blobs created by callers are validated when they are serialized, not when they are constructed, and are caller allocations rather than part of an image allocation budget. Equality compares the bytes.
- Implements
Constructors
| Name | Description |
|---|---|
| MetadataBlob(ReadOnlySpan<byte>) | Initializes a new instance of the MetadataBlob class by copying the specified bytes. |
MetadataBlob(ReadOnlySpan<byte>)
MetadataBlob.csInitializes a new instance of the MetadataBlob class by copying the specified bytes.
public MetadataBlob(ReadOnlySpan<byte> data)Parameters
dataReadOnlySpan<byte>- The bytes to copy.
Properties
| Name | Description |
|---|---|
| Length | Gets the number of bytes. |
| Memory | Gets the bytes as read-only memory. |
| Span | Gets the bytes as a read-only span. |
Length
MetadataBlob.csMemory
MetadataBlob.csSpan
MetadataBlob.csMethods
| Name | Description |
|---|---|
| Equals(MetadataBlob?) | Indicates whether the current object is equal to another object of the same type. |
| Equals(object?) | Determines whether the specified object is equal to the current object. |
| GetHashCode() | Serves as the default hash function. |
| ToArray() | Copies the bytes to a new array. |
Equals overloads
Equals(MetadataBlob?)
MetadataBlob.csIndicates whether the current object is equal to another object of the same type.
public bool Equals(MetadataBlob? other)Parameters
otherMetadataBlob?- An object to compare with this object.
Returns
bool true if the current object is equal to the other parameter; otherwise, false.
Equals(object?)
MetadataBlob.csGetHashCode()
MetadataBlob.csToArray()
MetadataBlob.csCopies the bytes to a new array.
public byte[] ToArray()Returns
byte[] A new array containing a copy of the bytes.