fromBytes static method
Implementation
static EUI64ResponseRecord fromBytes({
required String name,
required int ttl,
required Uint8List bytes,
required int offset,
required int length }) {
if (length != 8 || offset + 8 > bytes.length) {
throw FormatException('Invalid EUI-48 record: expected 6 bytes, got $length.');
}
final Uint8List mac = bytes.sublist(offset, offset + 8);
final String macStr = mac.map((b) => b.toRadixString(16).padLeft(2, '0').toUpperCase()).join('-');
return EUI64ResponseRecord(
name: name,
ttl: ttl,
macBytes: mac,
macAddress: macStr);
}