15 Files, Input/Output Streams, NIO and XML Serialization

Objectives

In this chapter you’ll:

  • Create, read, write and update files.

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

  • Learn the differences between text files and binary files.

  • Use class Formatter to output text to a file.

  • Use class Scanner to input text from a file.

  • Use sequential file processing to develop a real-world credit-inquiry program.

  • Write objects to and read objects from a file using XML serialization and the JAXB (Java Architecture for XML Binding) APIs.

  • Use a JFileChooser dialog to allow users to select files or directories on disk.

  • Optionally use java.io interfaces and classes to perform byte-based and character-based input and output. ...

Get Java How To Program, Late Objects, 11th 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.