public class BasicMessageBuilder

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)

Implement IMessageBuilder.BodyStream

public virtual final IDictionary Headers (r)

Implement IMessageBuilder.Headers

public IBasicProperties Properties (r)

Retrieve the IBasicProperties associated with this instance.

public NetworkBinaryWriter Writer (r)

Retrieve this instance's NetworkBinaryWriter writing to BodyStream.

Constructor Summary

Flags Name Summary
public BasicMessageBuilder(IModel model, int initialAccumulatorSize)

Construct an instance ready for writing.

public BasicMessageBuilder(IModel model)

Construct an instance ready for writing.

Method Summary

Flags Name Summary
public virtual byte[] GetContentBody()

Implement IMessageBuilder.GetContentBody

public virtual IContentHeader GetContentHeader()

Implement IMessageBuilder.GetContentHeader

public virtual string GetDefaultContentType()

Implement IMessageBuilder.GetDefaultContentType(). Returns null; overridden in subclasses.

public virtual final IMessageBuilder RawWrite(byte b)

Implement IMessageBuilder.RawWrite

public virtual final IMessageBuilder RawWrite(byte[] bytes)

Implement IMessageBuilder.RawWrite

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

Implement IMessageBuilder.RawWrite

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

Implement IMessageBuilder.BodyStream

public virtual final IDictionary Headers (r)

Summary

Implement IMessageBuilder.Headers

public IBasicProperties Properties (r)

Summary

Retrieve the IBasicProperties associated with this instance.

public NetworkBinaryWriter Writer (r)

Summary

Retrieve this instance's NetworkBinaryWriter writing to BodyStream.

Remarks

If no NetworkBinaryWriter 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, int initialAccumulatorSize)

Parameters
Name Type
model IModel
initialAccumulatorSize int

Summary

Construct an instance ready for writing.

BasicMessageBuilder

public BasicMessageBuilder(IModel model)

Parameters
Name Type
model IModel

Summary

Construct an instance ready for writing.

Remarks

The DefaultAccumulatorSize is used for the initial accumulator buffer size.

Method Detail

GetContentBody

public virtual byte[] GetContentBody()

Flags public virtual
Return type byte[]

Summary

Implement IMessageBuilder.GetContentBody

GetContentHeader

public virtual IContentHeader GetContentHeader()

Flags public virtual
Return type IContentHeader

Summary

Implement IMessageBuilder.GetContentHeader

GetDefaultContentType

public virtual string GetDefaultContentType()

Flags public virtual
Return type string

Summary

Implement IMessageBuilder.GetDefaultContentType(). Returns null; overridden in subclasses.

RawWrite

public virtual final IMessageBuilder RawWrite(byte b)

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

Summary

Implement IMessageBuilder.RawWrite

RawWrite

public virtual final IMessageBuilder RawWrite(byte[] bytes)

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

Summary

Implement IMessageBuilder.RawWrite

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

Implement IMessageBuilder.RawWrite