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