BitConverter.IsLittleEndian Feld

Definition

Gibt die Bytereihenfolge ("Endianität") an, in der Daten in dieser Computerarchitektur gespeichert werden.

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

Feldwert

Beispiele

Das folgende Codebeispiel veranschaulicht die Verwendung des IsLittleEndian Felds.

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

Hinweise

Verschiedene Computerarchitekturen speichern Daten mithilfe verschiedener Bytereihenfolgen. "Big-endian" bedeutet, dass das wichtigste Byte am linken Ende eines Worts liegt. "Little-endian" bezeichnet das wichtigste Byte am rechten Ende eines Worts.

Note

Sie können von der Bytereihenfolge des Hostcomputers in die Bytereihenfolge konvertieren, ohne den Wert des BitConverter.IsLittleEndian Felds abzurufen, indem Sie eine 16-Bit-, 32-Bit- oder 64-Bit-Ganzzahl an die IPAddress.HostToNetworkOrder Methode übergeben.

Gilt für: