Beispiel #1
0
 internal static void Encode(Multiple <T> multiple, ByteBuffer buffer)
 {
     if (multiple == null)
     {
         AmqpEncoding.EncodeNull(buffer);
     }
     else if (multiple.Count == 1)
     {
         AmqpEncoding.EncodeObject(multiple[0], buffer);
     }
     else
     {
         ArrayEncoding.Encode(multiple.ToArray(), buffer);
     }
 }
Beispiel #2
0
 internal static int GetEncodeSize(Multiple <T> multiple)
 {
     if (multiple == null)
     {
         return(FixedWidth.NullEncoded);
     }
     else if (multiple.Count == 1)
     {
         return(AmqpEncoding.GetObjectEncodeSize(multiple[0]));
     }
     else
     {
         return(ArrayEncoding.GetEncodeSize(multiple.ToArray()));
     }
 }