Text and I/O

The part that leaves the program and reaches the disk: Scanner over standard input and the newline nextInt leaves, Files.readString and readAllLines, writing with Files.writeString and APPEND, and Path with resolve, relativize and Files.walk. Bytes and binary files come next, with ByteBuffer and a small binary record, then charsets and the mojibake a file written in UTF-8 and read in another charset gives. java.time and the formatters of dates and numbers per locale follow, with regular expressions and a log line parsed by groups, and the capstone reads, checks and writes a CSV file.

104 Scanner and standard input nextLine, nextInt, hasNext, the newline nextInt leaves, a menu loop Open 105 Reading files Files.readString, readAllLines, lines(), a missing file and its exception Open 106 Writing files Files.writeString, APPEND, createDirectories, a written file read back Open 107 Path and directories Path.of, resolve, relativize, normalize, Files.walk, a directory listing Open 108 Bytes and binary files Files.readAllBytes, write, ByteBuffer, a small binary record Open 109 Charsets and UTF-8 StandardCharsets, a file written in UTF-8 and read in another charset, the mojibake it gives Open 110 java.time LocalDate, LocalTime, Duration, Period, Instant, arithmetic across a month Open 111 Formatting dates and numbers DateTimeFormatter, NumberFormat, Locale, the same date in two locales Open 112 Regular expressions Pattern, Matcher, groups, replaceAll, a log line parsed Open 113 Capstone: a CSV file a reader with split, a quoted field, a writer, the round trip checked Open

Lessons