<PackageReference Include="System.Drawing.Common" Version="10.0.0-preview.1.25080.3" />

BinaryObjectString

String record.
using System.IO; using System.Runtime.CompilerServices; namespace System.Private.Windows.BinaryFormat.Serializer { [NullableContext(1)] [Nullable(0)] internal sealed class BinaryObjectString : IWritableRecord, IRecord, IRecord<BinaryObjectString> { public Id ObjectId { get; } public string Value { get; } Id IRecord.Id { get { return ObjectId; } } public static RecordType RecordType => RecordType.BinaryObjectString; public BinaryObjectString(Id objectId, string value) { ObjectId = objectId; Value = value; } void IWritableRecord.Write(BinaryWriter writer) { writer.Write((byte)RecordType); writer.Write(ObjectId); writer.Write(Value); } [NullableContext(2)] public override bool Equals(object obj) { if (this != obj) { BinaryObjectString binaryObjectString = obj as BinaryObjectString; if (binaryObjectString != null && binaryObjectString.ObjectId == ObjectId) return binaryObjectString.Value == Value; return false; } return true; } public override int GetHashCode() { return HashCode.Combine(ObjectId, Value); } public override string ToString() { return Value; } } }