/// <summary> /// Constructs an ANAME record by reading bytes from a return message /// </summary> /// <param name="pointer">A logical pointer to the bytes holding the record</param> internal ANameRecord(Pointer pointer) { byte b1 = pointer.ReadByte(); byte b2 = pointer.ReadByte(); byte b3 = pointer.ReadByte(); byte b4 = pointer.ReadByte(); // this next line's not brilliant - couldn't find a better way though _ipAddress = IPAddress.Parse(string.Format("{0}.{1}.{2}.{3}", b1, b2, b3, b4)); }
// An ANAME records consists simply of an IP address /// <summary> /// Constructs an ANAME record by reading bytes from a return message /// </summary> /// <param name="pointer">A logical pointer to the bytes holding the record</param> internal ANameRecord(Pointer pointer) { var b1 = pointer.ReadByte(); var b2 = pointer.ReadByte(); var b3 = pointer.ReadByte(); var b4 = pointer.ReadByte(); // this next line's not brilliant - couldn't find a better way though IPAddress = IPAddress.Parse($"{b1}.{b2}.{b3}.{b4}"); }
internal TXTRecord(Pointer pointer) { Length = pointer.ReadByte(); var sb = new StringBuilder(Length); for (int i = 0; i < Length; i++) { sb.Append(pointer.ReadChar()); } Value = sb.ToString(); }