Function CSPFile::Read()
Description:
Reads data from the file and copies them in buffer Data.
 |
Prototype:
bool Read(CSPBuffer& Data, unsigned long ulSize = 0);
Arguments:
- CSPBuffer& Data [IN]
The buffer to copy the read data to.
- unsigned long ulSize = 0 [IN]
The size of bytes to read.
Return value:
If successful, it returns true. Otherwise, it returns false.
Remarks:
If ulSize is not zero, it reads ulSize bytes from the file and resizes Data to ulSize bytes too.
If ulSize is zero and Data size is not zero, it reads data from the file until Data is full.
If ulSize is zero and Data size is zero, it reads all the available data in the file and resizes Data appropriately to fit all this amount of read data.
Examples:
CSPFile File; CSPBuffer Data;
//Open the file File.Open( "MyFile.abc" );
//Read all the data in the file File.Read( Data );
See also:
member functions Write(), GetBytes()
|
|