In addition to the Stream interface, the java.util.stream package also provides specialized interfaces—IntStream, DoubleStream, and LongStream—that are optimized for processing streams of corresponding primitive types. They are very convenient to use, and have numeric operations, such as max(), min(), average(), sum().
The numeric interfaces have methods similar to the methods of the Stream interface, which means that everything we have talked about in the previous recipe, Creating and operating on streams, applies to numeric streams too. That is why, in this section, we will only talk about the methods that are not present in the Stream interface.