public class BasicMessageBuilder

Known direct subtypes: BytesMessageBuilder, MapMessageBuilder, StreamMessageBuilder

Summary

Framework for constructing various types of AMQP. Basic-class application messages.

Field Summary

Flags Type Name Summary
public const int DefaultAccumulatorSize

By default, new instances of BasicMessageBuilder and its subclasses will have this much initial buffer space.

Property Summary

Flags Type Name Summary
public virtual final Stream BodyStream (r)

Retrieve the being used to construct the message body.

public virtual final IDictionary<string,object> Headers (r)

Retrieves the dictionary that will be used to construct the message header table. It is of type .

public IBasicProperties Properties (rw)

Retrieve the associated with this instance.

public NetworkBinaryWriter Writer (r)

Retrieve this instance's writing to BodyStream.

Constructor Summary

Flags Name Summary
public BasicMessageBuilder(IModel model)

Construct an instance ready for writing.

public BasicMessageBuilder(IModel model, int initialAccumulatorSize)

Construct an instance ready for writing.

Method Summary

Flags Name Summary
public virtual byte[] GetContentBody()

Finish and retrieve the content body for transmission.

public virtual IContentHeader GetContentHeader()

Returns the default MIME content type for messages this instance constructs, or null if none is available or relevant.

public virtual string GetDefaultContentType()

Returns the default MIME content type for messages this instance constructs, or null if none is available or relevant.

public virtual final IMessageBuilder RawWrite(byte value)

Write a single byte into the message body, without encoding or interpretation.

public virtual final IMessageBuilder RawWrite(byte[] bytes)

Write a byte array into the message body, without encoding or interpretation.

public virtual final IMessageBuilder RawWrite(byte[] bytes, int offset, int length)

Write a section of a byte array into the message body, without encoding or interpretation.

Field Detail

public const int DefaultAccumulatorSize

Summary

By default, new instances of BasicMessageBuilder and its subclasses will have this much initial buffer space.

Property Detail

public virtual final Stream BodyStream (r)

Summary

Retrieve the being used to construct the message body.

public virtual final IDictionary<string,object> Headers (r)

Summary

Retrieves the dictionary that will be used to construct the message header table. It is of type .

public IBasicProperties Properties (rw)

Summary

Retrieve the associated with this instance.

public NetworkBinaryWriter Writer (r)

Summary

Retrieve this instance's writing to BodyStream.

Remarks

If no instance exists, one is created, pointing at the beginning of the accumulator. If one already exists, the existing instance is returned. The instance is not reset.

Constructor Detail

BasicMessageBuilder

public BasicMessageBuilder(IModel model)

Parameters
Name Type
model IModel

Summary

Construct an instance ready for writing.

Remarks

The is used for the initial accumulator buffer size.

BasicMessageBuilder

public BasicMessageBuilder(IModel model, int initialAccumulatorSize)

Parameters
Name Type
model IModel
initialAccumulatorSize int

Summary

Construct an instance ready for writing.

Method Detail

GetContentBody

public virtual byte[] GetContentBody()

Flags public virtual
Return type byte[]

Summary

Finish and retrieve the content body for transmission.

GetContentHeader

public virtual IContentHeader GetContentHeader()

Flags public virtual
Return type IContentHeader

Summary

Returns the default MIME content type for messages this instance constructs, or null if none is available or relevant.

GetDefaultContentType

public virtual string GetDefaultContentType()

Flags public virtual
Return type string

Summary

Returns the default MIME content type for messages this instance constructs, or null if none is available or relevant.

RawWrite

public virtual final IMessageBuilder RawWrite(byte value)

Flags public virtual final
Return type IMessageBuilder
Parameters
Name Type
value byte

Summary

Write a single byte into the message body, without encoding or interpretation.

RawWrite

public virtual final IMessageBuilder RawWrite(byte[] bytes)

Flags public virtual final
Return type IMessageBuilder
Parameters
Name Type
bytes byte[]

Summary

Write a byte array into the message body, without encoding or interpretation.

RawWrite

public virtual final IMessageBuilder RawWrite(byte[] bytes, int offset, int length)

Flags public virtual final
Return type IMessageBuilder
Parameters
Name Type
bytes byte[]
offset int
length int

Summary

Write a section of a byte array into the message body, without encoding or interpretation.