public static byte[] EncodeNetworkAddressKey(NetworkAddressKey networkAddressKey) { using (var stream = new MemoryStream()) using (var writer = new BinaryWriter(stream)) { EncodeNetworkAddressKey(writer, networkAddressKey); return(stream.ToArray()); } }
public static void EncodeNetworkAddressKey(BinaryWriter writer, NetworkAddressKey networkAddressKey) { writer.WriteVarBytes(networkAddressKey.IPv6Address.ToArray()); writer.Write(networkAddressKey.Port); }