Skip to content
This repository has been archived by the owner on Jan 16, 2019. It is now read-only.

File stream

Frank Kleine edited this page Aug 3, 2014 · 2 revisions

File related streams

To read data from a file one may use the stubbles\streams\file\FileInputStream class. Its constructor expects either a name of a file, or an already opened file pointer resource. If it is the name of the file the second parameter of the constructor sets the mode in which the file is opened, it defaults to rb (binary reading).

To write data to a file one may use the stubbles\streams\file\FileOutputStream class. Similarly to the file input stream class its constructor expects either a name of a file, or an already opened file pointer resource. If it is the name of the file the second parameter of the constructor sets the mode in which the file is opened, it defaults to wb (binary writing).

Warning: the mode parameter accepts modes which might not make any sense with the stream class - e.g. the input stream allows wb as value for the mode parameter, but then you can not read from the given file, and vice versa for the output stream.

The file input stream is a seekable stream.

Clone this wiki locally