Skip to main content

Working with Files

  • Chapter
  • First Online:
Java for Absolute Beginners
  • 2892 Accesses

Abstract

One of the most important functions in software is information organizing and storage, with the goal of using it and sharing it. Information is written on paper and stored in organized cabinets in real life where it can be retrieved from. Software applications do something similar. Information is written in files, files are organized in directories and eventually when in even more complex structures named databases. Java provides classes to read information from files and databases and classes to write files and write information to databases. In Chapter 9 , a simple example using a Derby in-memory database was introduced to show you how heavy dependencies like databases can be mocked to allow unit testing. This chapter is not about using databases, because writing Java applications for databases requires extra software to be installed. Instead, the chapter focuses on reading and writing files, and the many ways it can be done.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 29.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Project Amber official page http://openjdk.java.net/projects/amber/

  2. 2.

    Official GitHub repository for the company that produces the Jackson library https://github.com/FasterXML

  3. 3.

    The portable pixmap format (PPM), the portable graymap format (PGM) and the portable bitmap format (PBM) are image file formats designed to be easily exchanged between platforms. They are also sometimes referred to collectively as the portable any map format (PNM). More details at https://en.wikipedia.org/wiki/Netpbm_format

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Iuliana Cosmina

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Cosmina, I. (2018). Working with Files. In: Java for Absolute Beginners. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-3778-6_11

Download citation

Publish with us

Policies and ethics