Next: , Previous: , Up: Classes   [Index]


ReadFileStream

ReadFileStream Class

The ReadFileStream class contains methods and objects for reading files.

Instance Variables

None

Class Variables

stdinStream

The stdinStream object contains the value of the application’s standard input channel.

Instance Methods

new (stream1, stream2, stream3,...)

Creates one or more new ReadFileStream objects with the names given in the argument list; e.g.,


ReadFileStream new stream1, stream2, stream3;

openOn (String path)

Open file path with mode ‘r’ and set the receiver’s value to the file input stream.

readAll (void)

Returns a String with the contents of the receiver’s file stream.

readChar (void)

Returns a Character from the stream defined by the receiver, or ‘EOF’ at the end of the input.

readFormat (char *fmt, ...)

Read formatted input from the receiver and store in the objects given as arguments.

readLine (void)

Returns a String of characters up to and including the next newline of the stream defined by the receiver, or a String containing ‘EOF’ at the end of the input.

readRec (Integer record_length)

Return a String that contains record_length characters from the receiver’s input stream.

readVec (LongInteger data_length)

Reads data_length bytes from the receiver stream and returns a new Vector object that points to the data. This is useful for reading binary data which may have embedded NULLs and other non-human readable characters. See Vector.

value

Returns the receiver’s value instance variable.

Class Methods

classInit

Called automatically by new when the first ReadFileStream object is created. Initializes stdinStream.


Next: , Previous: , Up: Classes   [Index]