public static String[] mapToStrings(Map<String, String[]> mapList) {
String[] res = new String[0];
for (String[] s : mapList.values()) {
int a = res.length;
int b = s.length;
res= Arrays.copyOf(res,a + b);//扩容
System.arraycopy(s, 0, res, a,b);//将第二个数组与第一个数组合并
}
return res;
}
版权声明:本文为sinat_21634237原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。