Exemple #1
0
 public static void ReadSizeAndCount(ByteBuffer buffer, FormatCode formatCode, FormatCode formatCode8, FormatCode formatCode32, out int size, out int count)
 {
     if (formatCode == formatCode8)
     {
         size  = AmqpBitConverter.ReadUByte(buffer);
         count = AmqpBitConverter.ReadUByte(buffer);
     }
     else if (formatCode == formatCode32)
     {
         size  = (int)AmqpBitConverter.ReadUInt(buffer);
         count = (int)AmqpBitConverter.ReadUInt(buffer);
     }
     else
     {
         throw GetInvalidFormatCodeException(formatCode, buffer.Offset);
     }
 }
Exemple #2
0
 public static AmqpException GetInvalidFormatCodeException(FormatCode formatCode, int position)
 {
     return(GetEncodingException(string.Format(CultureInfo.CurrentCulture, "Invalid format code: {0} at position {1}.", formatCode, position)));
 }
Exemple #3
0
 public override object DecodeObject(ByteBuffer buffer, FormatCode formatCode)
 {
     return(DecimalEncoding.Decode(buffer, formatCode));
 }