CSharp examples for System:Byte Array
Convert byte array To UInt
/*************************************************************************** * * 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 w w .jav a 2 s.c o m public class Main{ /// <summary> /// /// </summary> /// <param name="ushortBuffer"></param> /// <param name="iBufferIndex"></param> /// <returns></returns> public static ushort ToUInt16( byte[] ushortBuffer, int iBufferIndex ) { return BitConverter.ToUInt16( ushortBuffer, iBufferIndex ); } /// <summary> /// /// </summary> /// <param name="ushortBuffer"></param> /// <returns></returns> public static ushort ToUInt16( byte[] ushortBuffer ) { return BitConverter.ToUInt16( ushortBuffer, 0 ); } }