Skip to main content

File Handling

  • Chapter
  • First Online:
  • 4389 Accesses

Abstract

With all our programs so far, there has been a very fundamental limitation: all data accepted is held only for as long as the program remains active. As soon as the program finishes execution, any data that has been entered and the results of processing such data are thrown away. Of course, for very many real-life applications (banking, stock control, financial accounting, etc.), this limitation is simply not realistic. These applications demand persistent data storage. That is to say, data must be maintained in a permanent state, such that it is available for subsequent further processing. The most common way of providing such persistent storage is to use disc files. Java provides such a facility, with the access to such files being either serial or random. The following sections explain the use of these two file access methods, firstly for non-GUI applications and later for GUI applications. In addition, the important and often neglected topic of serialisation is covered.

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer-Verlag London

About this chapter

Cite this chapter

Graba, J. (2013). File Handling. In: An Introduction to Network Programming with Java. Springer, London. https://doi.org/10.1007/978-1-4471-5254-5_4

Download citation

  • DOI: https://doi.org/10.1007/978-1-4471-5254-5_4

  • Published:

  • Publisher Name: Springer, London

  • Print ISBN: 978-1-4471-5253-8

  • Online ISBN: 978-1-4471-5254-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics