Streams in the Wild
summary
Live coding shows how to implement custom Spliterators to feed Stream pipelines: a no-op, a filtering and a mapping Spliterator plus a repeating splitter that duplicates elements. Code demonstrates implementing tryAdvance/trySplit/estimateSize and manipulating characteristics bits, handling sorted streams by supplying comparators, avoiding estimateSize overflow, and ensuring onClose propagation to upstream resources. Live examples run and print expected results; cautions cover calling the consumer only once, parallel thread-safety, and when parallelism harms performance.
AI-written summary · about
chapters (15)
- 0:00Introduction
- 0:18Stream API
- 1:15Who am I
- 1:30Questions
- 2:04Bullet Points
- 3:37StreamFactory
- 5:17SplitOrator
- 6:33Create another stream
- 16:07Filtering splitter method
- 18:54Adaptive filtering
- 22:30Repeating splitter
- 27:50Illegal state exception
- 30:31Mapping splitter
- 33:10Calling the closing method
- 36:10Calling streams on resources
related talks
47mStreams – Below the Surface
44mThinking in Streams
46mThinking in Streams
51mIf Streams Are So Great, Let’s Use Them Everywhere... Right??
45mStream Gatherers
01h 00mLet’s Get to the Rapids: Java 8 Stream Performance
43mStream Gatherers - Deep Dive with the Expert
40mStream Gathers - The biggest change to Java Streams since 10 years
