Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

BitConverter::IsLittleEndian Field

 

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

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

public:
static initonly bool IsLittleEndian

Field Value

Type: System::Boolean

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.

System_CAPS_noteNote

You can convert from network byte order to the byte order of the host computer without retrieving the value of the BitConverter::IsLittleEndian field by passing a 16-bit, 32-bit, or 64 bit integer to the IPAddress::HostToNetworkOrder method.

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

// Example of the BitConverter::IsLittleEndian field.
using namespace System;
int main()
{
   Console::WriteLine( "This example of the BitConverter::IsLittleEndian field "
   "generates \nthe following output when run on "
   "x86-class computers.\n" );
   Console::WriteLine( "IsLittleEndian:  {0}", BitConverter::IsLittleEndian );
}

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

IsLittleEndian:  True
*/

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show:
© 2017 Microsoft