Solclient
SDTUtilsCreateStream Method (IMessage, Int32) |
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.
Namespace: SolaceSystems.Solclient.Messaging.SDT
Assembly: SolaceSystems.Solclient.Messaging (in SolaceSystems.Solclient.Messaging.dll) Version: 7.2.1.27 (7.2.1.27)
Syntax
public static IStreamContainer CreateStream( IMessage message, int initialSize )
Public Shared Function CreateStream ( message As IMessage, initialSize As Integer ) As IStreamContainer
public: static IStreamContainer^ CreateStream( IMessage^ message, int initialSize )
Parameters
- message
- Type: SolaceSystems.Solclient.MessagingIMessage
The message to create the map container in. - initialSize
- Type: SystemInt32
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
Type: IStreamContainerThe created stream container.
Exceptions
Exception | Condition |
---|---|
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