/// <summary> /// Attempts to convert this blob to a <see cref="string"/>, /// expecting that the internal representation is a valid UTF-8 string. /// </summary> /// <remarks> /// Not all blobs are convertible to strings. /// Even if the blob is representable as a <see cref="string"/>, it's not guaranteed to round trip /// to the same string used to construct it. /// </remarks> public override string ToString() { return(InternedBlob.ToString(handle)); }
/// <summary> /// Returns the content of the blob. /// </summary> /// <remarks> /// Blobs constructed from bytes will always contain return the same bytes, /// regardless of the content. /// Blobs constructed from strings will return the binary representation /// of the string after it was converted to UTF-8. /// </remarks> public ReadOnlySpan <byte> ToSpan() { return(InternedBlob.ToSpan(handle)); }
/// <summary> /// Indicates whether the current object is equal to the provided <see cref="InternedBlob"/> /// (referencing the same internal object). /// </summary> /// <param name="other">A <see cref="InternedBlob"/> object to compare with this object.</param> /// <returns>true if the current object references the same interned data; otherwise, false.</returns> public bool Equals(InternedBlob other) { return(other.Equals(this)); }