Preface xiii
Acknowledgments xvii
Chapter 1: Streams 1
1.1 From Iterating to Stream Operations 1
1.2 Stream Creation 4
1.3 The filter, map, and flatMap Methods 10
1.4 Extracting Substreams and Combining Streams 12
1.5 Other Stream Transformations 13
1.6 Simple Reductions 14
1.7 The Optional Type 16
1.8 Collecting Results 24
1.9 Collectors 25
1.10 Reduction Operations 43
1.11 Gatherers 45
1.12 Primitive Type Streams 52
1.13 Parallel Streams 58
Chapter 2: Input and Output 63
2.1 Input/Output Streams 63
2.2 Reading and Writing Binary Data 87
2.3 Working with Files 96
2.4 Memory-Mapped Files 113
2.5 File Locking 123
2.6 Object Input/Output Streams and Serialization 126
2.7 Regular Expressions 150
Chapter 3: XML 167
3.1 Introducing XML 167
3.2 The Structure of an XML Document 169
3.3 Parsing an XML Document 172
3.4 Validating XML Documents 181
3.5 Locating Information with XPath 199
3.6 Using Namespaces 203
3.7 Streaming Parsers 206
3.8 Generating XML Documents 215
3.9 XSL Transformations 225
Chapter 4: Networking 237
4.1 Connecting to a Server 237
4.2 Implementing Servers 245
4.3 Getting Web Data 259
4.4 The HTTP Client 277
4.5 The Simple HTTP Server 286
4.6 Sending E-Mail 290
Chapter 5: Database Programming 293
5.1 The Design of JDBC 293
5.2 The Structured Query Language 296
5.3 JDBC Configuration 302 l