Exemplo n.º 1
0
 public override void EncodeObject(object value, bool arrayEncoding, ByteBuffer buffer)
 {
     if (arrayEncoding)
     {
         AmqpBitConverter.WriteDouble(buffer, (double)value);
     }
     else
     {
         DoubleEncoding.Encode((double)value, buffer);
     }
 }
Exemplo n.º 2
0
 public override int GetObjectEncodeSize(object value, bool arrayEncoding)
 {
     if (arrayEncoding)
     {
         return(FixedWidth.Double);
     }
     else
     {
         return(DoubleEncoding.GetEncodeSize((double)value));
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Decodes a 64-bit floating point number from the buffer and advances the buffer's position.
 /// </summary>
 /// <param name="buffer">The buffer to read.</param>
 /// <returns>A 64-bit floating point number.</returns>
 public static double?DecodeDouble(ByteBuffer buffer)
 {
     return(DoubleEncoding.Decode(buffer, 0));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Encodes a 64-bit floating point number and appends the bytes to the buffer.
 /// </summary>
 /// <param name="data">The 64-bit floating point number.</param>
 /// <param name="buffer">The destination buffer.</param>
 public static void EncodeDouble(double?data, ByteBuffer buffer)
 {
     DoubleEncoding.Encode(data, buffer);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Gets the encode size of a 64-bit floating point number.
 /// </summary>
 /// <param name="value">The 64-bit floating pointer number.</param>
 /// <returns>Encode size in bytes of the 64-bit floating pointer number.</returns>
 public static int GetDoubleEncodeSize(double?value)
 {
     return(DoubleEncoding.GetEncodeSize(value));
 }
Exemplo n.º 6
0
 public override object DecodeObject(ByteBuffer buffer, FormatCode formatCode)
 {
     return(DoubleEncoding.Decode(buffer, formatCode));
 }