Java中:多个byte[]应该存放到哪个数组中???然后怎么取到???

如题所述

你可以建立一个ArrayList集合:
ArrayList<Byte[]> list = new ArrayList<Byte[]>();
存入Byte[]时:
list.add(byte);

删除时:
list.remove(byte);
读取byte数组时,可以通过遍历获取或者直接list.get(下标);
温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-04-08
给你两个思路:
1、把byte数组转为arrylist,然后组合这些arrylist;
2、把byte数组变为String,然后组合到一块,再进行String遍历
第2个回答  2013-04-06
byte[] a = new byte[]{1,2,3};
byte[] b = new byte[]{4,5,6};
byte[] c = new byte[]{7,8,9};
byte[][] d = new byte[3][3];
d[0] = a;
d[1] = b;
d[2] = c;
for (int i=0;i<d.length;i++ )
{
byte[] by = d[i];
for (int j=0;j < by.length ;j++ )
{
System.out.println(by[j]);
}
}本回答被网友采纳
第3个回答  2015-10-07
List<byte[]> list=new ArrayList<byte[]>();
放到list里面吧