-
Notifications
You must be signed in to change notification settings - Fork 1
File stream
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.