How can I convert Stream<int[]>
into int[]
without using forEach
?
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();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.