void EncodeSection(ByteBuffer buffer, IAmqpSerializable section) { if (section != null) { section.Encode(buffer); } }
/// <summary> /// Sends a serializable object. The buffer is initialized by the /// <see cref="IAmqpSerializable.Encode(ByteBuffer)"/> method. /// </summary> /// <param name="dataBlock">The serializable object.</param> public void SendDatablock(IAmqpSerializable dataBlock) { ByteBuffer buffer = new ByteBuffer(dataBlock.EncodeSize, true); dataBlock.Encode(buffer); this.asyncIO.WriteBuffer(buffer); }
public void SendDatablock(IAmqpSerializable dataBlock) { ByteBuffer buffer = new ByteBuffer(new byte[dataBlock.EncodeSize]); dataBlock.Encode(buffer); int size = buffer.Length; this.asyncIO.WriteBuffer(buffer); }
public static void EncodeSerializable(IAmqpSerializable data, ByteBuffer buffer) { if (data == null) { AmqpEncoding.EncodeNull(buffer); return; } data.Encode(buffer); }
public override void EncodeValue(ByteBuffer buffer) { IAmqpSerializable value = base.Value as IAmqpSerializable; if (value != null) { value.Encode(buffer); return; } base.EncodeValue(buffer); }
public override void EncodeValue(ByteBuffer buffer) { IAmqpSerializable amqpSerializable = this.Value as IAmqpSerializable; if (amqpSerializable != null) { amqpSerializable.Encode(buffer); } else { base.EncodeValue(buffer); } }
public static void EncodeObject(object value, ByteBuffer buffer) { if (value == null) { AmqpEncoding.EncodeNull(buffer); return; } IAmqpSerializable amqpSerializable = value as IAmqpSerializable; if (amqpSerializable != null) { amqpSerializable.Encode(buffer); return; } AmqpEncoding.GetEncoding(value).EncodeObject(value, false, buffer); }
public static void EncodeObject(object value, ByteBuffer buffer) { if (value == null) { EncodeNull(buffer); return; } IAmqpSerializable serializable = value as IAmqpSerializable; if (serializable != null) { serializable.Encode(buffer); return; } EncodingBase encoding = GetEncoding(value); encoding.EncodeObject(value, false, buffer); }