AMPS C# Client  5.3.3.4
AMPS C# Client for .NET
AMPS.Client.CompositeMessageBuilder Class Reference

Used to create payloads for AMPS composite messages, which are messages with a number of parts where each part is a complete message of a specific message type. For example, a composite message type of "composite-json-binary" may be declared on the server that combines a set of JSON headers with an opaque binary payload. CompositeMessageBuilder makes it easy to assemble this payload. More...

Public Member Functions

 CompositeMessageBuilder ()
 Create a new, empty CompositeMessageBuilder. More...
 
 CompositeMessageBuilder (int initialCapacity_)
 Create a new empty CompositeMessageBuilder. More...
 
CompositeMessageBuilder clear ()
 Clears this object. Does not release or resize internal buffer. More...
 
CompositeMessageBuilder append (byte[] data_, int offset_, int length_)
 Appends a message part to this object. More...
 
CompositeMessageBuilder append (String data_)
 Appends a message part to this object. More...
 
void setField (Field field_)
 Sets a Field with the contents of this object. More...
 

Public Attributes

byte[] _bytes = null
 
int _position = 0
 

Detailed Description

Used to create payloads for AMPS composite messages, which are messages with a number of parts where each part is a complete message of a specific message type. For example, a composite message type of "composite-json-binary" may be declared on the server that combines a set of JSON headers with an opaque binary payload. CompositeMessageBuilder makes it easy to assemble this payload.

Constructor & Destructor Documentation

◆ CompositeMessageBuilder() [1/2]

AMPS.Client.CompositeMessageBuilder.CompositeMessageBuilder ( )
inline

Create a new, empty CompositeMessageBuilder.

◆ CompositeMessageBuilder() [2/2]

AMPS.Client.CompositeMessageBuilder.CompositeMessageBuilder ( int  initialCapacity_)
inline

Create a new empty CompositeMessageBuilder.

Parameters
initialCapacity_The default capacity in bytes for the serialized representation of a message. Ideal value is total message size in bytes + ( 4 * number of message parts).

Member Function Documentation

◆ append() [1/2]

CompositeMessageBuilder AMPS.Client.CompositeMessageBuilder.append ( byte[]  data_,
int  offset_,
int  length_ 
)
inline

Appends a message part to this object.

Parameters
data_The bytes of the data to append.
offset_The offset in data_ where your data begins.
length_The length of your data.
Returns
this object

◆ append() [2/2]

CompositeMessageBuilder AMPS.Client.CompositeMessageBuilder.append ( String  data_)
inline

Appends a message part to this object.

Parameters
data_The data to append.
Returns
this object

◆ clear()

CompositeMessageBuilder AMPS.Client.CompositeMessageBuilder.clear ( )
inline

Clears this object. Does not release or resize internal buffer.

Returns
this object

◆ setField()

void AMPS.Client.CompositeMessageBuilder.setField ( Field  field_)
inline

Sets a Field with the contents of this object.

Parameters
field_the Field to set.

The documentation for this class was generated from the following file: