转换 ArrayList<Byte>成一个字节[] [英] Convert ArrayList<Byte> into a byte[]
本文介绍了转换 ArrayList<Byte>成一个字节[]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能的重复:
如何将包含整数的 ArrayList 转换为原始整数数组?
如何将ArrayList
转换成byte[]
?
ArrayList.toArray()
返回一个 Byte[]
.
推荐答案
调用 toArray() 后可以将结果传递给 Apache Commons 的 toPrimitive 方法:
After calling toArray() you can pass the result into the Apache Commons toPrimitive method:
这篇关于转换 ArrayList<Byte>成一个字节[]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文