var packet = new WowPacket(); if (packet.CanRead()) { var myCustomValue = packet.Read (); // do something with myCustomValue... }
var packet = new WowPacket(); while (packet.CanRead()) { var nextValue = packet.ReadNext(); // process nextValue... }Here, we're using CanRead to check if the packet has any more data to read. If it does, we use the ReadNext method to extract the next value from the packet. We continue this loop until the CanRead method returns false, indicating that we've read all of the data in the packet. Based on the library used, I can determine that this is likely the WowPacketParser library.