BitConverter

BitConverter CF 1.0

System (mscorlib.dll) sealed class

This class provides static methods that can be used to convert portions of a byte array to simple value types. It also contains the overloaded GetBytes( ) method, which converts simple data types to byte arrays. These functions can be useful for creating custom reader and writer classes. For example, a typical writer class might take specific data, convert it to a byte array, then pass the byte array to some type of stream object.

 public sealed class  BitConverter  {  // Public Static Fields  public static readonly bool  IsLittleEndian  ;  // =True   // Public Static Methods  public static long  DoubleToInt64Bits  (double   value   );    public static byte[ ]  GetBytes  (bool   value   );    public static byte[ ]  GetBytes  (char   value   );    public static byte[ ]  GetBytes  (double   value   );    public static byte[ ]  GetBytes  (short   value   );    public static byte[ ]  GetBytes  (int   value   );    public static byte[ ]  GetBytes  (long   value   );    public static byte[ ]  GetBytes  (float   value   );    public static byte[ ]  GetBytes  (ushort   value   );    public static byte[ ]  GetBytes  (uint   value   );    public static byte[ ]  GetBytes  (ulong   value   );    public static double  Int64BitsToDouble  (long   value   );    public static bool  ToBoolean  (byte[ ]   value   , int   startIndex   );    public static char  ToChar  (byte[ ]   value   , int   startIndex   );    public static double  ToDouble  (byte[ ]   value   , int   startIndex   );    public static short  ToInt16  (byte[ ]   value   , int   startIndex   );    public static int  ToInt32  (byte[ ]   value   , int   startIndex   );    public static long  ToInt64  (byte[ ]   value   , int   startIndex   );    public static float  ToSingle  (byte[ ]   value   , int   startIndex   );    public static string  ToString  (byte[ ]   value   );    public static string  ToString  (byte[ ]   value   , int   startIndex   );    public static string  ToString  (byte[ ]   value   , int   startIndex   , int   length   );    public static ushort  ToUInt16  (byte[ ]   value   , int   startIndex   );    public static uint  ToUInt32  (byte[ ]   value   , int   startIndex   );    public static ulong  ToUInt64  (byte[ ]   value   , int   startIndex   ); } 


C# in a Nutshell
C # in a Nutshell, Second Edition
ISBN: 0596005261
EAN: 2147483647
Year: 2005
Pages: 963

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net