Share via


BitConverter.IsLittleEndian Alan

Tanım

Verilerin bu bilgisayar mimarisinde depolandığı bayt sırasını ("endianness") gösterir.

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

Alan Değeri

Örnekler

Aşağıdaki kod örneği, alanının kullanımını IsLittleEndian gösterir.

// 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

Açıklamalar

Farklı bilgisayar mimarileri verileri farklı bayt siparişlerini kullanarak depolar. "Big-endian", en önemli bayt sözcüğün sol ucundadır anlamına gelir. "Küçük endian", en önemli baytın bir sözcüğün sağ ucunda olduğu anlamına gelir.

Not

yöntemine 16 bit, 32 bit veya 64 bit tamsayı geçirerek alanın değerini BitConverter.IsLittleEndian almadan ağ bayt sırasını konak bilgisayarın bayt sırasına IPAddress.HostToNetworkOrder dönüştürebilirsiniz.

Şunlara uygulanır