mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
add check
This commit is contained in:
parent
a938455c2e
commit
c2707b6180
@ -18,6 +18,7 @@
|
|||||||
* 【core 】 JarClassLoader增加构造(pr#593@Gitee)
|
* 【core 】 JarClassLoader增加构造(pr#593@Gitee)
|
||||||
* 【core 】 增加Pid,以便获取单例pid
|
* 【core 】 增加Pid,以便获取单例pid
|
||||||
* 【core 】 Img增加全覆盖水印pressTextFull(pr#595@Gitee)
|
* 【core 】 Img增加全覆盖水印pressTextFull(pr#595@Gitee)
|
||||||
|
* 【core 】 ByteUtil.numberToBytes增加Byte判断(issue#2252@Github)
|
||||||
|
|
||||||
### 🐞Bug修复
|
### 🐞Bug修复
|
||||||
* 【core 】 修复UserAgentUtil识别Linux出错(issue#I50YGY@Gitee)
|
* 【core 】 修复UserAgentUtil识别Linux出错(issue#I50YGY@Gitee)
|
||||||
|
@ -405,7 +405,9 @@ public class ByteUtil {
|
|||||||
* @return bytes
|
* @return bytes
|
||||||
*/
|
*/
|
||||||
public static byte[] numberToBytes(Number number, ByteOrder byteOrder) {
|
public static byte[] numberToBytes(Number number, ByteOrder byteOrder) {
|
||||||
if (number instanceof Double) {
|
if(number instanceof Byte){
|
||||||
|
return new byte[]{number.byteValue()};
|
||||||
|
}else if (number instanceof Double) {
|
||||||
return doubleToBytes((Double) number, byteOrder);
|
return doubleToBytes((Double) number, byteOrder);
|
||||||
} else if (number instanceof Long) {
|
} else if (number instanceof Long) {
|
||||||
return longToBytes((Long) number, byteOrder);
|
return longToBytes((Long) number, byteOrder);
|
||||||
|
Loading…
Reference in New Issue
Block a user