public void PackPacket() { Debug.Assert(!m_bSplitted); byte[] output = null; bool result = MpdUtilities.Compress(Buffer, Size, out output); if (!result || Size <= output.Length) { return; } if (Protocol == MuleConstants.PROTOCOL_KADEMLIAHEADER) { Protocol = MuleConstants.PROTOCOL_KADEMLIAPACKEDPROT; } else { Protocol = MuleConstants.PROTOCOL_PACKEDPROT; } Array.Copy(output, Buffer, output.Length); Size = (uint)output.Length; m_bPacked = true; }