有没有我可以使用的标准方法来代替这个自定义方法?
public static Byte[] box(byte[] byteArray) {
Byte[] box = new Byte[byteArray.length];
for (int i = 0; i < box.length; i++) {
box[i] = byteArray[i];
}
return box;
}
最佳答案
不,JDK中没有这种方法。
然而,通常情况下,Apache Commons Lang提供such a method .
关于java - 是否有内置的 Java 方法来装箱数组?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2585907/