Convert byte array To Double - CSharp System

CSharp examples for System:Byte Array

Description

Convert byte array To Double

Demo Code

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU Lesser General Public License as published
 *   by the Free Software Foundation; either version 2.1 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/
using System.Text;
using System;//from w  ww .j a va 2  s  .com

public class Main{
        /// <summary>
        /// 
        /// </summary>
        /// <param name="ulongBuffer"></param>
        /// <param name="iBufferIndex"></param>
        /// <returns></returns>
        public static double ToDouble( byte[] ulongBuffer, int iBufferIndex )
        {
            return BitConverter.ToDouble( ulongBuffer, iBufferIndex );
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="ulongBuffer"></param>
        /// <returns></returns>
        public static double ToDouble( byte[] ulongBuffer )
        {
            return BitConverter.ToDouble( ulongBuffer, 0 );
        }
}

Related Tutorials