gpt4 book ai didi

java - 如何将 byte[] 转换为 Byte[] 和其他方式?

转载 作者:IT老高 更新时间:2023-10-28 13:54:00 25 4
gpt4 key购买 nike

如何将 byte[] 转换为 Byte[] 以及 Byte[] 转换为 byte[] ,在不使用任何第三方库的情况下?

有没有办法只使用标准库快速完成?

最佳答案

字节[]到字节[]:

byte[] bytes = ...;
Byte[] byteObject = ArrayUtils.toObject(bytes);

字节[]到字节[]:

Byte[] byteObject = new Byte[0];
byte[] bytes = ArrayUtils.toPrimitive(byteObject);

关于java - 如何将 byte[] 转换为 Byte[] 和其他方式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12944377/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com