<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FDevelopment%2FBitConverter</id>
		<title>Csharp/CSharp Tutorial/Development/BitConverter - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FDevelopment%2FBitConverter"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Development/BitConverter&amp;action=history"/>
		<updated>2026-04-29T14:56:10Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Development/BitConverter&amp;diff=5205&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Development/BitConverter&amp;diff=5205&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:53Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Development/BitConverter&amp;diff=5206&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Development/BitConverter&amp;diff=5206&amp;oldid=prev"/>
				<updated>2010-05-26T12:14:36Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==BitConverter==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Convert a built-in data type into an array of bytes.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;public static readonly bool IsLittleEndian&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;BitConverter is sealed, which means that it cannot be inherited.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Methods Defined by BitConverter&amp;lt;/p&amp;gt;&lt;br /&gt;
Method&lt;br /&gt;
Meaning&lt;br /&gt;
public static longDoubleToInt64Bits(double v)&lt;br /&gt;
Converts v into a long integer.&lt;br /&gt;
public static byte[ ] GetBytes(bool v)&lt;br /&gt;
Converts v into a 1-byte array.&lt;br /&gt;
public static byte[ ] GetBytes(char v)&lt;br /&gt;
Converts v into a 2-byte array.&lt;br /&gt;
public static byte[ ] GetBytes(double v)&lt;br /&gt;
Converts v into an 8-byte.&lt;br /&gt;
public static byte[ ] GetBytes(float v)&lt;br /&gt;
Converts v into a 4-byte.&lt;br /&gt;
public static byte[ ] GetBytes(int v)&lt;br /&gt;
Converts v into a 4-byte.&lt;br /&gt;
public static byte[ ] GetBytes(long v)&lt;br /&gt;
Converts v into an 8-byte.&lt;br /&gt;
public static byte[ ] GetBytes(short v)&lt;br /&gt;
Converts v into a 2-byte.&lt;br /&gt;
public static byte[ ] GetBytes(uint v)&lt;br /&gt;
Converts v into a 4-byte.&lt;br /&gt;
public static byte[ ] GetBytes(ulong v)&lt;br /&gt;
Converts v into an 8-byte.&lt;br /&gt;
public static byte[ ] GetBytes(ushort v)&lt;br /&gt;
Converts v into a 2-byte.&lt;br /&gt;
public static doubleInt64BitsToDouble(long v)&lt;br /&gt;
Converts v into a double floating-point value.&lt;br /&gt;
public static bool ToBoolean(byte[ ] a,int idx)&lt;br /&gt;
Converts the byte at a[idx] into its bool equivalent. A non-zero value is converted to true; zero is converted to false.&lt;br /&gt;
public static char ToChar(byte[ ] a,int start)&lt;br /&gt;
Converts two bytes starting at a[start] into its char equivalent.&lt;br /&gt;
public static double ToDouble(byte[ ] a,int start)&lt;br /&gt;
Converts eight bytes starting at a[start] into its double equivalent.&lt;br /&gt;
public static short ToInt16(byte[ ] a,int start)&lt;br /&gt;
Converts two bytes starting at a[start] into its short equivalent.&lt;br /&gt;
public static int ToInt32(byte[ ] a,int start)&lt;br /&gt;
Converts four bytes starting at a[start] into its int equivalent.&lt;br /&gt;
public static long ToInt64(byte[ ] a,int start)&lt;br /&gt;
Converts eight bytes starting at a[start] into its long equivalent.&lt;br /&gt;
public static float ToSingle(byte[ ] a,int start)&lt;br /&gt;
Converts four bytes starting at a[start] into its float equivalent.&lt;br /&gt;
public static string ToString(byte[ ] a)&lt;br /&gt;
Converts the bytes in a into a string. The string contains the hexadecimal values associated with the bytes, separated by hyphens.&lt;br /&gt;
public static string ToString(byte[ ] a, int start)&lt;br /&gt;
Converts the bytes in a, beginning at a[start], into a string. The string contains the hexadecimal values associated with the bytes, separated by hyphens.&lt;br /&gt;
public static string ToString(byte[ ] a, int start, int count)&lt;br /&gt;
Converts the bytes in a, beginning at a[start] and running for count bytes, into a string. The string contains the hexadecimal values associated with the bytes, separated by hyphens.&lt;br /&gt;
public static ushort ToUInt16(byte[ ] a,int start)&lt;br /&gt;
Converts two bytes starting at a[start] into its ushort equivalent and returns the result.&lt;br /&gt;
public static uint ToUInt32(byte[ ] a,int start)&lt;br /&gt;
Converts four bytes starting at a[start] into its uint equivalent and returns the result.&lt;br /&gt;
public static ulong ToUInt64(byte[ ] a,int start)&lt;br /&gt;
Converts eight bytes starting at a[start] into its ulong equivalent and returns the result.&lt;br /&gt;
&lt;br /&gt;
==Convert a bool to a byte array and display==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.IO;&lt;br /&gt;
 &lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
    public static void Main() &lt;br /&gt;
    {&lt;br /&gt;
        byte[] b = null;&lt;br /&gt;
        &lt;br /&gt;
        b = BitConverter.GetBytes(true);&lt;br /&gt;
        Console.WriteLine(BitConverter.ToString(b));&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;01&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Convert a byte array to a bool and display==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.IO;&lt;br /&gt;
 &lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
    public static void Main() &lt;br /&gt;
    {&lt;br /&gt;
        byte[] b = null;&lt;br /&gt;
        &lt;br /&gt;
        b = BitConverter.GetBytes(true);&lt;br /&gt;
        Console.WriteLine(BitConverter.ToBoolean(b,0));&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;True&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Convert a byte array to an int and display==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.IO;&lt;br /&gt;
 &lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
    public static void Main() &lt;br /&gt;
    {&lt;br /&gt;
        byte[] b = null;&lt;br /&gt;
        b = BitConverter.GetBytes(3678);&lt;br /&gt;
        Console.WriteLine(BitConverter.ToInt32(b,0));&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;3678&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Convert an int to a byte array and display==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.IO;&lt;br /&gt;
 &lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
    public static void Main() &lt;br /&gt;
    {&lt;br /&gt;
        byte[] b = null;&lt;br /&gt;
        b = BitConverter.GetBytes(3678);&lt;br /&gt;
        Console.WriteLine(BitConverter.ToString(b));&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;5E-0E-00-00&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Convert different data types to byte array and convert byte array back==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Net;&lt;br /&gt;
using System.Text;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
   public static void Main()&lt;br /&gt;
   {&lt;br /&gt;
      int test1 = 45;&lt;br /&gt;
      double test2 = 3.14159;&lt;br /&gt;
      int test3 = -1234567890;&lt;br /&gt;
      bool test4 = false;&lt;br /&gt;
      byte[] data = new byte[1024];&lt;br /&gt;
      string output;&lt;br /&gt;
      data = BitConverter.GetBytes(test1);&lt;br /&gt;
      output = BitConverter.ToString(data);&lt;br /&gt;
      Console.WriteLine(&amp;quot;test1 = {0}, string = {1}&amp;quot;, test1, output);&lt;br /&gt;
      data = BitConverter.GetBytes(test2);&lt;br /&gt;
      output = BitConverter.ToString(data);&lt;br /&gt;
      Console.WriteLine(&amp;quot;test2 = {0}, string = {1}&amp;quot;, test2, output);&lt;br /&gt;
      data = BitConverter.GetBytes(test3);&lt;br /&gt;
      output = BitConverter.ToString(data);&lt;br /&gt;
      Console.WriteLine(&amp;quot;test3 = {0}, string = {1}&amp;quot;, test3, output);&lt;br /&gt;
      data = BitConverter.GetBytes(test4);&lt;br /&gt;
      output = BitConverter.ToString(data);&lt;br /&gt;
      Console.WriteLine(&amp;quot;test4 = {0}, string = {1}&amp;quot;, test4, output);&lt;br /&gt;
   }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;test1 = 45, string = 2D-00-00-00&lt;br /&gt;
test2 = 3.14159, string = 6E-86-1B-F0-F9-21-09-40&lt;br /&gt;
test3 = -1234567890, string = 2E-FD-69-B6&lt;br /&gt;
test4 = False, string = 00&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>