Exemplo n.º 1
0
        /// <summary> 反序列化 | Deserialize(Parse bytes to object) </summary>
        /// <param name="typeName">自定义类型名称 | Custom type name</param>
        /// <param name="bytes">字节数组 | Byte array</param>
        public static T Deserialize <T>(string typeName, byte[] bytes) where T : new()
        {
            LBType customType;

            if (!LBConfig.TryGetCustomType(typeName, out customType))
            {
                throw new Exception("CustomType is null. Type name:" + typeName);
            }
            return(LBConverter.ToObject <T>(customType, bytes));
        }