VpeCreateMemoryStream

<< Click to Display Table of Contents >>

Navigation:  Memory Streams >

VpeCreateMemoryStream

Previous pageReturn to chapter overviewNext page

[Professional Edition and above]

Creates a new empty stream in memory. A memory stream can grow as large as you wish, the size is only limited by available memory. VPE divides a memory stream into chunks of equal size - by default 16 KB. This means that an initial stream only occupies 16 KB of memory. If you write more data to a memory stream, the memory stream is enlarged by additional chunks as required. Internally VPE stores each chunk separately and links each chunk with the next.

VpeHandle VpeCreateMemoryStream(

VpeHandle hDoc,

long chunk_size

)

VpeHandle hDoc

Document Handle

long chunk_size

The size of each chunk, if you set this parameter to zero, VPE uses a default chunk size of 16 KB, which is a reasonable value.

Returns:

A handle to the created memory stream. In case of an error, the returned handle is NULL.

 

You must ALWAYS close all streams you ever opened or created, when you have done using them. Not doing so will result in memory leaks (only at the moment your application is closed, all streams will be released from memory). Calling CloseDoc() will not close streams.

Remarks:

sets LastError