PFStream¶
A stream is a sequence of bytes. Small streams (<256K) reside in memory, and large streams are flushed to temporary files. These files are created in the folder specified during initialization of the library. If the library is not initialized when 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 the number of bytes in the stream.
-
tStreamPos copyTo(PFStream *pStream);¶
- Description:
Copies the stream contents to another stream.
-
tStreamPos setEndOfStream();¶
- Description:
Sets the stream end at the current position.
-
void reset();¶
- Description:
Clears the stream contents.