10.26.0

SDTUtilsCreateStream(IMessage, Int32) Method

Creates a stream container (IStreamContainer) in the binary attachment part of the given message. Any existing data is overwritten. The returned IStreamContainer instance can be later used to add SDT fields. It is recommended to Close the IStreamContainer when done. If it is not explicitly closed, the stream is automatically closed when the associated message is disposed IDisposable.

Whether it is explicitly closed by the client application, or implicitly by the API, any attempt to use this stream will result in an OperationErrorException with ParamNullReference error subcode.

Definition

Namespace: SolaceSystems.Solclient.Messaging.SDT
Assembly: SolaceSystems.Solclient.Messaging (in SolaceSystems.Solclient.Messaging.dll) Version: 10.26.0
C#
public static IStreamContainer CreateStream(
	IMessage message,
	int initialSize
)

Parameters

message  IMessage
The message to create the map container in.
initialSize  Int32
This parameter must be greater than or equal to zero. It hints to the size of the stream to be created, it is used to determine the size of the datablock to allocate. If it is too small for the subsequently created stream, a larger datablock is allocated when necessary and existing SDT data is copied into place. This reallocation can negatively affect performance.

Return Value

IStreamContainer
The created stream container.

Exceptions

ArgumentNullException Thrown when the message is null.
OperationErrorException Thrown when an error occurs. In this case ReturnCode and SDKErrorInfo are accessible from OperationErrorException and contain more information.
FatalErrorException Thrown when an unrecoverable error occurs.
ArgumentOutOfRangeException Thrown when initialSize is less than zero.

See Also