image

CHAPTER5

Starting Streams: Sources and Spliterators

Chapter 3 briefly introduced the subject of stream sources in general, but the subsequent stream processing examples have all used either collections or stream factory methods for their source. This reflects the expected mainstream usage, but it is now time to explore other aspects of stream creation. In this chapter we will cover

• Stream-bearing methods of the platform classes

• Treatment of exceptions thrown by stream sources and in intermediate operations

• The mechanism by which stream sources work

• An example bringing these topics together

5.1 Creating Streams

After the stream-bearing ...

Get Mastering Lambdas now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.