PFStream¶
A stream is sequence of bytes. Small streams (<256K) reside in memory, and large streams are flushed to temporary files. These files are created in a folder specified during initializing the library. If the library is not initialized during creating a stream, the files are created in a temporary folder.
-
tStreamPos seek(tStreamPos offset, int origin);¶
- Parameters:
offset – Offset from origin
origin – FILE_BEGIN, FILE_CURRENT or FILE_END
- Description:
Moves the stream pointer to a specified location.
-
tStreamSize read(void *buffer, tStreamSize size);¶
- Parameters:
buffer – Pointer to data buffer
size – Size of buffer
- Description:
Reads data from a stream and returns the number of bytes actually read.
-
tStreamSize write(const void *buffer, tStreamSize size);¶
- Parameters:
buffer – Pointer to data buffer
size – Size of buffer
- Description:
Writes data to a stream and returns the number of bytes actually written.
-
tStreamPos size();
- Description:
Returns number of bytes in stream.
-
tStreamPos copyTo(PFStream *pStream);¶
- Description:
Copies stream contents to another stream.
-
tStreamPos setEndOfStream();¶
- Description:
Set the stream end at the current position.
-
void reset();¶
- Description:
Clear the stream contents.