We cover the difference between text and binary files, the basic byte streams
InputStream/
OutputStream and their file implementations (
FileInputStream,
FileOutputStream). We write buffered copy, discuss read speed one byte at a time vs in blocks, writing byte arrays via
write(),
try-with-resources nuances, choosing a buffer size of
4–
16 KB, safe use of
readAllBytes(), and common pitfalls (for example, using
FileReader/
FileWriter for binary data).