Lesson 5 of 918 minModule progress 0%

Module 9: Advanced Core Features

File I/O with java.io

Read, write, and buffer text/binary streams using the classic IO APIs.

Wrap FileInputStream in BufferedInputStream to reduce disk calls; use InputStreamReader for charset conversion.

Always close streams in try-with-resources to prevent leaks.

For small files, Files.readAllLines or readString simplify operations.

Advertisement

Lesson check

Why wrap streams in buffered variants?

Next lesson →