企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# 组件源码 ``` /** * <b>方法描述:</b> 反序列化对象 <br/> * <b>创建者:</b> admin <br/> * <b>创建时间:</b> 2021-01-28 17:13:42 <br/> * * @param bytes 入参|byte 数组|{@link Object} * @param obj 出参|对象|{@link Object} * @return -1 异常<br/> * 1 成功<br/> */ @Component(label = "反序列化对象", style = "判断型", type = "同步组件", comment = "将对象的byte数组转换成bean对象", version = "1.0.0", deprecated = false, author = "admin", date = "2021-01-28 05:13:42") @InParams(param = { @Param(name = "bytes", comment = "byte 数组", type = Object.class) }) @OutParams(param = { @Param(name = "obj", comment = "对象", type = Object.class) }) @Returns(returns = { @Return(id = "-1", desp = "异常"), @Return(id = "1", desp = "成功") }) @Order(value = 2) public static ResultBase P_ByteToObect(Object bytes) { Object obj = null; try { ByteArrayInputStream bi = new ByteArrayInputStream((byte[]) bytes); ObjectInputStream oi = new ObjectInputStream(bi); obj = oi.readObject(); bi.close(); oi.close(); } catch (Exception e) { AppLog.error(e); return ResultBase.newExceptionResult("TPTB0013", "获取对象属性值集合异常:" + AppLog.errorMsg(e)); } return ResultBase.newSuccessResult(obj); } ``` # 交易中组件使用方式 ![](https://img.kancloud.cn/bd/e5/bde577d62875e2d8eadd5b15fd31d1bc_1868x891.png) # 参数说明及示例 ## 入口参数 byte 数组:序列化之后的 byte 数组,示例: `__INNER__["byte"]` ## 出口参数 对象:反序列化后的对象,示例: `__INNER__["result"]`