[英]in Java 8, how can I get int array from Stream<int[]> without using forEach
How can I convert Stream<int[]>
into int[]
without using forEach
? 如何在不使用forEach
情况下将Stream<int[]>
转换为int[]
?
final Stream<int[]> stream = foos.stream()
.map(foos -> insertQuery(contact, create))
.map(create::batch)
.map(Batch::execute); //Batch::execute will return the int[]
int[] result = stream.flatMapToInt(Arrays::stream).toArray();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.