bookmark

Efficient multiple-stream concatenation in Java - TechEmpower Blog


Description

Stream<String> a = Stream.of("one", "two"); Stream<String> b = Stream.of("three", "four");

Stream.concat(a, b); or Stream.of(a, b, c) .reduce(Stream::concat) .orElseGet(Stream::empty); or Stream.of(a, b, c).flatMap(s -> s);

Preview

Tags

Users

  • @jil

Comments and Reviews