const char* GetStreamContents_ns ( stream_ns*  strm,   long*  length )

Returns the memory buffer associated with memory stream strm, which will contain the results of any writing Netica has done to the stream.

The result returned is only valid until the next call using this memory stream. If the result is needed longer than that, it should be duplicated. Do not attempt to modify or free the result returned. Calling this function does not remove or alter the buffer's contents; a subsequent call will yield the same results.

*length will be set to the number of bytes in the buffer, excluding any null terminator. It's value upon entry is ignored.

If strm is not a memory stream (i.e., created by NewMemoryStream_ns), an error will be generated.

Version:

Versions 2.26 and later have this function.

See also:

NewMemoryStream_ns    Create new memory stream
SetStreamContents_ns    Sets buffer

Example:

See NewMemoryStream_ns.
Example 2:
See SetStreamPassword_ns.