public override void EncodeObject(object value, bool arrayEncoding, ByteBuffer buffer) { if (arrayEncoding) { AmqpBitConverter.WriteDouble(buffer, (double)value); } else { DoubleEncoding.Encode((double)value, buffer); } }
public override int GetObjectEncodeSize(object value, bool arrayEncoding) { if (arrayEncoding) { return(FixedWidth.Double); } else { return(DoubleEncoding.GetEncodeSize((double)value)); } }
/// <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)); }
/// <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); }
/// <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)); }
public override object DecodeObject(ByteBuffer buffer, FormatCode formatCode) { return(DoubleEncoding.Decode(buffer, formatCode)); }