Message

Constructor

Visual Basic

Overloads Public Sub New()
Overloads Public Sub New(
    ByVal initialSize As UInt32)
Overloads Public Sub New(
    ByVal bytes As Byte() )
Overloads Public Sub New(
    ByVal message As Message)

C#

public Message();
public Message(uint initialSize);
public Message(byte[] bytes);
public Message(Message message);

Purpose

Create a message object.

Remarks

The constructor without an argument allocates 512 bytes of unmanaged storage and initializes it as a new message.

None of these constructors place address information on the new message object.

This class has no destroy() method. Instead, the garbage collector reclaims storage automatically.

Parameter

Description

initialSize

Allocate unmanaged storage of this size (in bytes) for the new message.

bytes

Fill the new message with data from this byte array.

For example, programs can create such byte arrays from messages using the method Message.ToByteArray, and store them in files; after reading them from such files, programs can reconstruct a message from its byte array.

message

Create an independent copy of this message. Field values are also independent copies.

See Also

Message.ToByteArray