您的位置:寻梦网首页编程乐园Java天地Core JavaJava Lecture Notes

Introduction

Content

Apply

Reflect

Extend

previous.gif
 (3087 bytes)

next.gif
 (2959 bytes)


Reflect Index

Reflect Page # 20

Discussion Topic 3 — Complexity of ways of reading files

In this unit we have described how a Java program could read a text file one line at a time — this required four classes. We have also described how a text file can be read as if it were an array of bytes, where any byte can be read at any position — this requires only one class: RandomAccessFile.

The job done by RandomAccessFile seems on the surface to be more complicated.

Why do we need four classes to read a text file one line at a time, but only one class to read it like a byte array?

Contribution for Discussion Topic 3 — Complexity of ways of reading files

Back to top

basicline.gif (169 bytes)

RITSEC - Global Campus
Copyright ?1999 RITSEC- Middlesex University. All rights reserved.
webmaster@globalcampus.com.eg