Contents Up Previous Next


This class represents data read in from a file. There are actually two such groups of classes: this one is based on wxFFile whereas wxFileInputStream is based in the wxFile class.

Note that wxFile and wxFFile differ in one aspect, namely when to report that the end of the file has been reached. This is documented in wxFile::Eof and wxFFile::Eof and the behaviour of the stream classes reflects this difference, i.e. wxFileInputStream will report wxSTREAM_EOF after having read the last byte whereas wxFFileInputStream will report wxSTREAM_EOF after trying to read past the last byte. Related to EOF behavior, note that SeekI() can seek beyond the end of the stream (file) and will thus not return wxInvalidOffset for that.

Derived from


Include files


See also

wxBufferedInputStream, wxFFileOutputStream, wxFileOutputStream




wxFFileInputStream(const wxString& filename, const wxChar * mode = "rb")

Opens the specified file using its filename name using the specified mode.

wxFFileInputStream(wxFFile& file)

Initializes a file stream in read-only mode using the file I/O object file.

wxFFileInputStream(FILE * fp)

Initializes a file stream in read-only mode using the specified file pointer fp.





bool Ok() const

Returns true if the stream is initialized and ready.