DhcpOption: code refactoring done.

This commit is contained in:
Shreyas Zare
2024-02-04 17:19:13 +05:30
parent 527378f0f0
commit 69c72073e1

View File

@@ -1,6 +1,6 @@
/*
Technitium DNS Server
Copyright (C) 2023 Shreyas Zare (shreyas@technitium.com)
Copyright (C) 2024 Shreyas Zare (shreyas@technitium.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -123,8 +123,7 @@ namespace DnsServerCore.Dhcp
public DhcpOption(DhcpOptionCode code, string hexValue)
{
if (hexValue is null)
throw new ArgumentNullException(nameof(hexValue));
ArgumentNullException.ThrowIfNull(hexValue);
_code = code;
@@ -136,8 +135,7 @@ namespace DnsServerCore.Dhcp
public DhcpOption(DhcpOptionCode code, byte[] value)
{
if (value is null)
throw new ArgumentNullException(nameof(value));
ArgumentNullException.ThrowIfNull(value);
_code = code;
_value = value;
@@ -151,7 +149,7 @@ namespace DnsServerCore.Dhcp
if (len < 0)
throw new EndOfStreamException();
_value = s.ReadBytes(len);
_value = s.ReadExactly(len);
}
protected DhcpOption(DhcpOptionCode code)