Files and Streams
- Byte and character streams. Java I/O layers streams: bytes at the bottom, readers and writers adding character encoding on top.
- Buffering. A buffered wrapper batches small reads and writes: the difference between seconds and minutes on big files.
- Encoding explicitly. Always name the charset: UTF-8 spelled out: or the platform default corrupts someone’s accents.
NIO
- Path and Files. The Files utility with Path handles modern file work: read, write, copy, walk: in single calls.
- Walking directories. Files.walk streams a directory tree: find every log file in three lines.
- Channels and buffers. NIO’s channels and buffers underpin high-throughput I/O: the layer servers stand on.
Serialisation and Data Handling
- Object serialisation caution. Built-in Java serialisation is legacy and dangerous with untrusted data: modern code prefers explicit formats.
- JSON in Java. Java speaks JSON through libraries: objects mapped to fields, with types checked at the boundary.
- Data integrity. Robust I/O writes atomically: temp file then move: so a crash never leaves half a file.
Before and after this level
- Before: Level 6: Functional Java: Lambdas, Streams, Functional Data Processing.
- Next: Level 8: Concurrency: Threads and Executors, Synchronisation and Shared State, Modern Concurrent Java.
In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.
Frequently asked questions
What does Java Level 7: Files & I/O cover?
Files and Streams, NIO, Serialisation and Data Handling: 3 lessons and 9 ideas.
What should I know before this level?
The level before it, Level 6: Functional Java, which covers Lambdas, Streams, Functional Data Processing.