public static T DecodeMap <T>(ByteBuffer buffer) where T : RestrictedMap, new() { AmqpMap amqpMaps = MapEncoding.Decode(buffer, 0); T t = default(T); if (amqpMaps != null) { t = Activator.CreateInstance <T>(); t.SetMap(amqpMaps); } return(t); }
internal static T DecodeMap <T>(ByteBuffer buffer) where T : RestrictedMap, new() { AmqpMap map = MapEncoding.Decode(buffer, 0); T restrictedMap = null; if (map != null) { restrictedMap = new T(); restrictedMap.SetMap(map); } return(restrictedMap); }
/// <summary> /// Decodes a map from the buffer and advances the buffer's position. /// </summary> /// <param name="buffer">The buffer to read.</param> /// <returns>A map.</returns> public static AmqpMap DecodeMap(ByteBuffer buffer) { return(MapEncoding.Decode(buffer, 0)); }
/// <summary> /// Encodes a map and appends the bytes to the buffer. /// </summary> /// <param name="data">The map.</param> /// <param name="buffer">The destination buffer.</param> public static void EncodeMap(AmqpMap data, ByteBuffer buffer) { MapEncoding.Encode(data, buffer); }
/// <summary> /// Gets the encode size of a map. /// </summary> /// <param name="value">The map.</param> /// <returns>Encode size in bytes of the map.</returns> public static int GetMapEncodeSize(AmqpMap value) { return(MapEncoding.GetEncodeSize(value)); }
public void DecodeValue(ByteBuffer buffer, int size, int count) { MapEncoding.ReadMapValue(buffer, this.innerMap, size, count); }
public override void DecodeValue(ByteBuffer buffer) { this.innerMap = MapEncoding.Decode(buffer, 0); }
public override void EncodeValue(ByteBuffer buffer) { MapEncoding.Encode(this.innerMap, buffer); }
public override int GetValueEncodeSize() { return(MapEncoding.GetEncodeSize(this.innerMap)); }