BitConverter.IsLittleEndian Bidang

Definisi

Menunjukkan urutan byte ("endianness") tempat data disimpan dalam arsitektur komputer ini.

public: static initonly bool IsLittleEndian;
public static readonly bool IsLittleEndian;
 staticval mutable IsLittleEndian : bool
Public Shared ReadOnly IsLittleEndian As Boolean 

Nilai Bidang

Contoh

Contoh kode berikut mengilustrasikan penggunaan IsLittleEndian bidang .

// 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
*/
// Example of the BitConverter.IsLittleEndian field.
using System;

class LittleEndDemo
{
    public static void 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
*/
open System

printfn $"This example of the BitConverter.IsLittleEndian field generates \nthe following output when run on x86-class computers.\n"
printfn $"IsLittleEndian:  {BitConverter.IsLittleEndian}"

// 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.
Module LittleEndDemo
    Sub Main( )
        Console.WriteLine( _
            "This example of the BitConverter.IsLittleEndian " & _
            "field generates " & vbCrLf & "the following output " & _
            "when run on x86-class computers." & vbCrLf )
        Console.WriteLine( "IsLittleEndian:  {0}", _
            BitConverter.IsLittleEndian )
    End Sub 
End Module

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

Keterangan

Arsitektur komputer yang berbeda menyimpan data menggunakan pesanan byte yang berbeda. "Big-endian" berarti byte yang paling signifikan ada di ujung kiri kata. "Little-endian" berarti byte yang paling signifikan ada di ujung kanan kata.

Catatan

Anda dapat mengonversi dari urutan byte jaringan ke urutan byte komputer host tanpa mengambil nilai BitConverter.IsLittleEndian bidang dengan meneruskan bilangan bulat 16-bit, 32-bit, atau 64 bit ke IPAddress.HostToNetworkOrder metode .

Berlaku untuk