Message Constructors

Definition

Overloads

Message()

Default constructor with no body data.

Message(Stream)

Constructor which uses the argument stream as the body stream.

Message(Byte[])

Creates a telemetry message with the specified payload.

Message()

Default constructor with no body data.

public Message ();
Public Sub New ()

Applies to

Message(Stream)

Constructor which uses the argument stream as the body stream.

public Message (System.IO.Stream stream);
new Microsoft.Azure.Devices.Message : System.IO.Stream -> Microsoft.Azure.Devices.Message
Public Sub New (stream As Stream)

Parameters

stream
Stream

a stream which will be used as body stream.

Remarks

User is expected to own the disposing of the stream when using this constructor.

Applies to

Message(Byte[])

Creates a telemetry message with the specified payload.

public Message (byte[] byteArray);
public Message (byte[] payload);
new Microsoft.Azure.Devices.Message : byte[] -> Microsoft.Azure.Devices.Message
new Microsoft.Azure.Devices.Message : byte[] -> Microsoft.Azure.Devices.Message
Public Sub New (byteArray As Byte())
Public Sub New (payload As Byte())

Parameters

byteArraypayload
Byte[]

A byte array which will be used to form the body stream.

Remarks

User should treat the input byte array as immutable when sending the message.

Applies to