nn::fs::FileInputStream Class

Syntax

class FileInputStream : 
    private nn::fs::IInputStream,
    private nn::fs::detail::FileBase,
    private ADLFireWall::NonCopyable

Description

Class for reading from files.

Can open the file specified by a path name and read data from it.

Although it is possible to use either wide-character strings or multibyte-character strings to specify the path name, use wide-character strings unless you have a special reason to do otherwise.

Limitations

Any discrepancy between the buffer alignment and the read position while reading from a file causes an extreme drop in performance. We recommend that you use a multiple of four bytes both for the buffer alignment and for file reads.

Member Functions

FileInputStream Constructor.
Initialize Opens the specified file.
TryInitialize Tries to open the specified file.
Finalize Closes a file.
V ~FileInputStream Destructor.
V Read Reads the specified amount of data from a file into a buffer.
V TryRead Reads the specified amount of data from a file into a buffer.
V Seek Changes the read position of a file.
V TrySeek Changes the read position of a file.
V GetPosition Gets the current read position relative to the start of the file.
V TryGetPosition Gets the current read position relative to the start of the file.
V SetPosition Sets the current read position relative to the start of the file.
V TrySetPosition Sets the current read position relative to the start of the file.
V GetSize Gets the file size.
V TryGetSize Gets the file size.

Class Hierarchy

nn::fs::IPositionable
  nn::fs::IInputStream
    nn::fs::FileInputStream

Revision History

2011/03/14
Added limitations on read positions and buffer alignment.
2010/01/29
Initial version.

CONFIDENTIAL