O'Reilly logo

Ivor Horton's Beginning Java™ 2, JDK™ 5th Edition by Ivor Horton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11. Reading Files

In this chapter you'll investigate how you read files containing basic types of data. You'll be exploring how to read files sequentially or at random and how you can open a file for both read and write operations.

In this chapter you'll learn:

  • How to obtain a file channel for reading a file

  • How to use buffers in file channel read operations

  • How to read different types of data from a file

  • How to retrieve data from random positions in a file

  • How you can read from and write to the same file

  • How you can do direct data transfer between channels

  • What a memory-mapped file is and how you can access a memory-mapped file

  • What a file lock is and how you can lock all or part of a file

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required