Non-Stream I/O Classes

StreamTokenizer allows to read through text files retrieving user-definable tokens instead of full-line strings. There are methods like quoteChar(), ordinaryChars() ... and more that define the lexical syntax of tokens. Calling nextToken() method we parse a token from the input stream, returning a type of the token. RandomAccessFile can be used to both read from and write to a single file. It provides not-stream oriented view of a file. Random access files can be constructed from file descriptors, file names, or file objects. This class offers methods that allow specified mode accesses of read-only or read-write to files. We read/write selected records from an existing file, without reading it from beginning to end. The seek(long) method of the class sets the file pointer to the specified absolute position. It's a convenient mechanism to update a specified record in a file.

Back to I/O Classes Overview