Tag: Java 8

Flatten Stream of Arrays or Lists in Java using Stream.concat() method

Java 8 Streams can holds different types of data. For example, Stream<T>, Stream<T[]>, Stream<List<T>> – all these are valid streams in Java 8. We have seen in the previous post that flatMap() method can be used for flattening Streams in Java. In this post, we will flatten Stream of Arrays or Lists using Stream.concat() method …

Convert IntStream to String in Java and Vice Versa

Since Java doesn’t offer any character Stream, we can create an IntStream (stream of ints) of characters when dealing with strings. In this post, we will discuss how to convert String to IntStream and IntStream to String in Java.