using System; using System.Linq; namespace ScreenConnect; [Serializable] public class HardwareAddress { public static readonly HardwareAddress None = new HardwareAddress(); private string? toStringCache; public byte[] Bytes { get; } public HardwareAddress(byte[]? bytes) { Bytes = bytes ?? Extensions.EmptyArray(); } public HardwareAddress() : this(null) { } public override string ToString() { return toStringCache ?? (toStringCache = (from _ in Bytes.SafeEnumerate() select _.ToString("X2")).Join(':')); } }