Why isn't there IntStream.flatMapToObj()?

前端 未结 3 1560
情话喂你
情话喂你 2021-01-04 03:40

I\'m trying to do something like this:

Stream stream = IntStream.of(...)
        .flatMapToObj(i -> getStreamOfObjects(i));


<         


        
      
      
      
3条回答
  •  半阙折子戏
    2021-01-04 03:48

    Just write

     IntStream.of(...).mapToObj(i -> getStreamOfObjects(i)).flatMap(stream -> stream)
    

提交回复
热议问题