Skip to content

Commit

Permalink
refactor: ♻️ 新增toJsonByte方法
Browse files Browse the repository at this point in the history
  • Loading branch information
fxbin committed Sep 23, 2023
1 parent a470298 commit c97b0ad
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions bubble-core/src/main/java/cn/fxbin/bubble/core/util/JsonUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@ public String toJson(Object object) {
}
}

/**
* json字节
*
* @param value jsonBean
* @return {@link byte[]}
*/
public byte[] toJsonByte(Object value) {
try {
return JacksonHolder.INSTANCE.writeValueAsBytes(value);
} catch (JsonProcessingException e) {
throw new UtilException(e);
}
}


/**
* isJsonString 是否为json格式字符串
Expand Down

0 comments on commit c97b0ad

Please sign in to comment.