本文整理汇总了C#中PacketIn.ToArray方法的典型用法代码示例。如果您正苦于以下问题:C# PacketIn.ToArray方法的具体用法?C# PacketIn.ToArray怎么用?C# PacketIn.ToArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketIn
的用法示例。
在下文中一共展示了PacketIn.ToArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Decrypt
public PacketIn Decrypt(PacketIn packet)
{
byte[] data = packet.ToArray();
decryption.Process(data, 4, data.Length - 4);
PacketIn result = new PacketIn(data, 0, data.Length);
result.Size = result.GetUint32Reversed();
result.Opcode = result.GetUint32Reversed();
Console.Write("Dcrptd:");
for (int i = 0; i < result.ToArray().Length; i++) Console.Write(" "+ result.ToArray()[i]);
Console.WriteLine();
return result;
}
示例2: Decrypt
public PacketIn Decrypt(PacketIn packet)
{
byte[] data = packet.ToArray();
decryption.Process(data, 4, data.Length - 4);
PacketIn result = new PacketIn(data, 0, data.Length);
result.Size = result.GetUint32Reversed();
result.Opcode = result.GetUint32Reversed();
Log.Info("[CLIENT POST-ENCRYPT]", this.DumpData(data));
return result;
}
示例3: Decrypt
public PacketIn Decrypt(PacketIn packet)
{
byte[] data = packet.ToArray();
decryption.Process(data, 4, data.Length - 4);
PacketIn result = new PacketIn(data, 0, data.Length);
result.Size = result.GetUint32Reversed();
result.Opcode = result.GetUint32Reversed();
/*
Console.Write("Dcrptd: ");
for (int i = 0; i < result.ToArray().Length; i++) Console.Write(" "+ result.ToArray()[i]);
Console.WriteLine();
*/
Log.Info("[CLIENT POST-ENCRYPT]", this.DumpData(data));
return result;
}