Compartilhar via


BitConverter.IsLittleEndian Field

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Indicates the byte order ("endianess") in which data is stored in this computer architecture.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Shared ReadOnly IsLittleEndian As Boolean
public static readonly bool IsLittleEndian

Remarks

This value is true if the architecture is little-endian; false if it is big-endian.

Different computer architectures store data using different byte orders. "Big-endian" means the most significant byte is on the left end of a word. "Little-endian" means the most significant byte is on the right end of a word.

Examples

The following code example illustrates the use of the IsLittleEndian field.

' Example of the BitConverter.IsLittleEndian field.

Module Example
   Public Sub Demo(ByVal outputBlock As System.Windows.Controls.TextBlock)
      outputBlock.Text &= _
          "This example of the BitConverter.IsLittleEndian " & _
          "field generates " & vbCrLf & "the following output " & _
          "when run on x86-class computers." & vbCrLf & vbCrLf
      outputBlock.Text &= String.Format("IsLittleEndian:  {0}", _
          BitConverter.IsLittleEndian) & vbCrLf
   End Sub
End Module

' This example of the BitConverter.IsLittleEndian field generates
' the following output when run on x86-class computers.
'
' IsLittleEndian:  True
// Example of the BitConverter.IsLittleEndian field.
using System;

class Example
{
   public static void Demo(System.Windows.Controls.TextBlock outputBlock)
   {
      outputBlock.Text +=
          "This example of the BitConverter.IsLittleEndian field " +
          "generates \nthe following output when run on " +
          "x86-class computers.\n" + "\n";
      outputBlock.Text += String.Format("IsLittleEndian:  {0}",
          BitConverter.IsLittleEndian) + "\n";
   }
}

/*
This example of the BitConverter.IsLittleEndian field generates
the following output when run on x86-class computers.

IsLittleEndian:  True
*/

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.