public static byte[] Wrap(byte[] message, int packHeadLen = 3) { if (message == null) { return(null); } uint msgLength = (uint)message.Length; if ((PacketConstDefine.SendSerializeType & SerializeType.Compress) != 0) { } if ((PacketConstDefine.SendSerializeType & SerializeType.Encript) != 0) { } dataCache.Clear(); uint flag = 0; CUtility.UInt8ToBytes(flag, dataCache); CUtility.UInt16ToBytes(msgLength, dataCache); CUtility.BytesToBytes(message, (int)msgLength, dataCache); return(dataCache.ToArray()); }