15. Files, Streams and Object Serialization

Consciousness ... does not appear to itself chopped up in bits. ... A “river” or a “stream” are the metaphors by which it is most naturally described.

—William James

Objectives

In this chapter you’ll:

Image Create, read, write and update files.

Image Retrieve information about files and directories using features of the NIO.2 APIs.

Image Learn the differences between text files and binary files.

Use class Formatter to ...

Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.