Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 /// <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));
 }
Ejemplo n.º 4
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);
 }
Ejemplo n.º 5
0
 /// <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));
 }
Ejemplo n.º 6
0
 public void DecodeValue(ByteBuffer buffer, int size, int count)
 {
     MapEncoding.ReadMapValue(buffer, this.innerMap, size, count);
 }
Ejemplo n.º 7
0
 public override void DecodeValue(ByteBuffer buffer)
 {
     this.innerMap = MapEncoding.Decode(buffer, 0);
 }
Ejemplo n.º 8
0
 public override void EncodeValue(ByteBuffer buffer)
 {
     MapEncoding.Encode(this.innerMap, buffer);
 }
Ejemplo n.º 9
0
 public override int GetValueEncodeSize()
 {
     return(MapEncoding.GetEncodeSize(this.innerMap));
 }