Loading…
Loading…
Java
The advanced-libraries companion to Core Java I: streams, files, regular expressions, XML, networking, databases, date & time, internationalisation, security, desktop UIs and the Foreign Function and Memory API. Targets Java 25.
Understand Java NIO buffers: ByteBuffer, CharBuffer and the typed buffers, capacity, position, limit and mark, the fill-flip-drain-compact cycle, absolute versus relative access, wrap, slice, duplicate and typed views, direct buffers, charset encoding, and copying between channels.
kvi5hnuCode Sprout team member10 minMap files into memory in Java with FileChannel.map: READ_ONLY, READ_WRITE and PRIVATE modes, MappedByteBuffer access, force, byte order, measured performance against streams and RandomAccessFile, the 2 GB limit, and Java 22's MemorySegment mapping with deterministic unmapping through an Arena.
kvi5hnuCode Sprout team member9 minVisit directory contents in Java: Files.list for direct children, Files.walk and find for whole trees, glob and regex patterns with PathMatcher, filtered DirectoryStreams, walkFileTree with SimpleFileVisitor, and recipes for copying and deleting directory trees safely.
kvi5hnuCode Sprout team member9 minCopy, move and delete files with java.nio.file.Files: REPLACE_EXISTING, COPY_ATTRIBUTES and ATOMIC_MOVE, copying to and from streams, delete versus deleteIfExists, exists and isRegularFile checks, size, BasicFileAttributes and PosixFileAttributes, timestamps, symbolic links and isSameFile.
kvi5hnuCode Sprout team member9 minUse java.nio.file.Files for everyday file work: readString, readAllLines, lines and readAllBytes, writeString and write with open options such as APPEND and CREATE_NEW, mismatch, probeContentType, buffered readers and writers, createFile, createDirectory, createDirectories and temporary files.
kvi5hnuCode Sprout team member9 minWork with file system paths using java.nio.file.Path: Path.of, absolute and relative paths, resolve and Java 22's multi-argument resolve, resolveSibling, relativize, normalize, toAbsolutePath, taking paths apart, startsWith, URIs and the legacy File class.
kvi5hnuCode Sprout team member8 minRead and write ZIP and JAR archives in Java: ZipInputStream and ZipOutputStream entry by entry, STORED entries with CRC32, random access with ZipFile, the ZIP file system provider that makes an archive look like a directory, JarOutputStream manifests, and protecting extraction against zip slip.
kvi5hnuCode Sprout team member9 minRead and write anywhere in a file with Java's RandomAccessFile: the r, rw, rws and rwd modes, the file pointer, seek, getFilePointer, length and setLength, storing fixed-size records, reading records in any order, updating a record in place, and when FileChannel is the better choice.
kvi5hnuCode Sprout team member7 minWrite and read binary data in Java with DataOutputStream and DataInputStream: fixed-size big-endian numbers, readFully and EOFException, unsigned reads, why writeUTF's modified UTF-8 isn't real UTF-8, portable length-prefixed strings, and handling little-endian data with ByteBuffer.
kvi5hnuCode Sprout team member8 minUnderstand how Java turns characters into bytes: how UTF-8 and UTF-16 encode code points, byte order marks, the Charset class and StandardCharsets, mojibake and strict decoders, UTF-8 as the default since Java 18, file.encoding and the stdout, stderr and stdin encodings, and reading code points.
kvi5hnuCode Sprout team member11 minRead and write text in Java: Files.readString, readAllLines and lines, Scanner tokens and the nextLine trap, BufferedReader, Java 25's Reader.readAllLines, PrintWriter with print, println, printf, autoflush and checkError, and saving records in a delimited text format.
kvi5hnuCode Sprout team member10 minCombine Java I/O stream filters: why FileInputStream and DataInputStream have separate jobs, layering DataInputStream over BufferedInputStream over FileInputStream, what buffering saves, PushbackInputStream, append mode, compression filters and writing your own filter.
kvi5hnuCode Sprout team member8 minStart with Java I/O: InputStream and OutputStream, read returning -1, readAllBytes, readNBytes, skipNBytes, transferTo, mark and reset, closing and flushing with try-with-resources, the byte and character class hierarchies, and the Closeable, Flushable, Readable and Appendable interfaces.
kvi5hnuCode Sprout team member11 minUse Java parallel streams correctly: parallelStream and parallel, why shared mutable state causes race conditions, encounter order and unordered(), groupingByConcurrent, when parallelism pays off, the common ForkJoinPool, running in a custom pool, and random numbers in parallel.
kvi5hnuCode Sprout team member10 minAvoid boxing with Java's IntStream, LongStream and DoubleStream. Create them with of, range, chars, codePoints and random generators, convert with mapToInt and boxed, and use sum, average, max, summaryStatistics and OptionalInt, plus the overflow and floating-point details.
kvi5hnuCode Sprout team member7 minWrite your own Java stream gatherers: the initializer, integrator, combiner and finisher, pushing elements downstream, Gatherer.of versus ofSequential, greedy versus short-circuiting integrators, finishers that flush state, and the rules for hand-written Gatherer classes.
kvi5hnuCode Sprout team member9 minUse Java 24's stream gatherers, the extension point for intermediate operations. Group elements with windowFixed and windowSliding, compare neighbors, fold and scan sequentially, run blocking calls on virtual threads with mapConcurrent, and chain gatherers with andThen.
kvi5hnuCode Sprout team member9 minMaster Java's Stream.reduce in its three forms: reduce with an Optional result, with an identity value, and with an accumulator and combiner. Learn why the operation must be associative, what a wrong identity does in parallel, and when to use the three-argument collect instead.
kvi5hnuCode Sprout team member8 minLearn how Java collectors work inside: the supplier, accumulator, combiner and finisher functions, the IDENTITY_FINISH, UNORDERED and CONCURRENT characteristics, building collectors with Collector.of, wrapping a downstream collector and the parallel bugs a bad combiner causes.
kvi5hnuCode Sprout team member9 minProcess the groups of a Java groupingBy with downstream collectors: counting, summingInt, averagingInt, maxBy, mapping, joining, filtering, flatMapping, collectingAndThen, summarizingInt, reducing, nested groupingBy and teeing for two results in one pass.
kvi5hnuCode Sprout team member7 min