private static byte[] Decode(byte[] packet) { var i = packet.Length - 1; while (packet[i] == 0) { --i; } var temp = new byte[i + 1]; Array.Copy(packet, temp, i + 1); return temp; }
private static byte[] Decode(byte[] packet) { var i = packet.Length - 1; while (packet[i] == 0) { --i; } var temp = new byte[i + 1]; Array.Copy(packet, temp, i + 1); return temp; }