Chapter 6: Stream IO

"What goes in, must come out."
—Glenn and Andrew

Introduction

In this chapter, you will learn how to utilize streams and files in your games. Files are especially useful if you do not have access or simply do not wish to use a database for storing your data. In fact, for single-player games, it really makes more sense to use files to save (for example, players' saved games or high scores). An important use of files is for loading in specific game data, such as a file storing level data. The key aspects of this chapter cover writing data to a file, reading data in from a file, and then finally how to save and retrieve entire objects (classes) to and from a file by using serialization.



Java 1.4 Game Programming
Java 1.4 Game Programming (Wordware Game and Graphics Library)
ISBN: 1556229631
EAN: 2147483647
Year: 2003
Pages: 237

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net