streams
17 tutorials tagged “streams”.
- Collectors Class in JavaThe Collectors class supplies ready-made collectors for collect(): toList, toSet, toMap, joining, counting, summing, averaging, groupingBy and more.
- Creating Streams in JavaWays to create a stream: from collections, arrays, Stream.of, ranges, iterate, generate, strings, files and builders, with examples of each.
- groupingBy, partitioningBy, toMap and JoiningThe four most used collectors: group elements by a key, split them in two, build maps and join strings, with downstream collectors and examples.
- In-Memory Streams in JavaByteArrayInputStream, ByteArrayOutputStream, StringReader, StringWriter, CharArrayReader and CharArrayWriter treat memory as a stream source or destination.
- Intermediate vs Terminal OperationsIntermediate stream operations return a new stream and are lazy; terminal operations produce a result and end the stream. Learn the full list of each.
- Java 8 FeaturesJava 8 brought lambdas, functional interfaces, method references, streams, Optional, default methods and a new date and time API. Learn each with examples.
- Java I/O Class HierarchyThe four abstract base classes of java.io, InputStream, OutputStream, Reader and Writer, their key methods, and the main subclasses of each.
- Java I/O StreamsJava I/O moves data in and out of a program through streams. Learn what a stream is, byte streams vs character streams, and the four base classes.
- Stream API in JavaThe Stream API processes collections in pipelines of filter, map, sorted and collect. Learn what a stream is, its features, its parts and a first example.
- Lazy Evaluation and Short-Circuiting in StreamsStreams process elements one at a time, only when needed, and can stop early. See the real order of operations, why infinite streams work, and the costs.