试图解决什么应该是一个简单的问题.有一个Bytes列表,想要在函数末尾将它转换为字节数组.
final List<Byte> pdu = new ArrayList<Byte>(); .... return pdu.toArray(new byte[pdu.size()]);;
编译器不喜欢我的语法toArray.如何解决这个问题?
toArray
java arrays collections
arrays ×1
collections ×1
java ×1