Overview Module Function Class Tea 3.1.0 Reference Documentation
© 2002 PDM&FC

Class TInput

Instances of TInput represent an input stream for reading strings from a source. TInput is only used as base class for other classes. It is not possible to create instances of it.

Method Summary
close
         Closes the input stream represented by the object.
copyTo output [byteCount]
         Copies the contents of the stream into an output stream.
readln
         Reads a line from the input stream represented by the object.

Method Detail

close

TInput close

Closes the input stream represented by the object.

Returns:
A reference to the object it was called for.

Closing the stream releases all the underlying operating system resources. After closing the stream no more methods may be called.

copyTo

TInput copyTo output [byteCount]

Copies the contents of the stream into an output stream.

Parameters:
output - An object that must responde to a write method.
byteCount - Integer representing the maximum number of bytes to copy into the the output stream.
Returns:
A reference to the object it was called for.

The output object received as argument is expected to respond to a write method that receives a byte array for argument.

This method works by reading a block from the underlying input stream and passing it to output by calling its write method. It repeats this two steps until an end of file condition is reached in the input stream or until byteCount bytes are read from the input stream. If there is no byteCount argument then the copy proceeds until the end of file on the input stream.


readln

TInput readln

Reads a line from the input stream represented by the object.

Returns:
The string containing the line that was read. The null object if the stream is at end of file.



Overview Module Function Class Tea 3.1.0 Reference Documentation
© 2002 PDM&FC
Report a bug or request new features
© 2002