Jazyk

BitConverter.IsLittleEndian Pole

Definice

Označuje pořadí bajtů ("endianness"), ve kterém jsou data uložena v této počítačové architektuře.

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

Hodnota pole

Příklady

Následující příklad kódu znázorňuje použití IsLittleEndian pole.

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

Poznámky

Různé počítačové architektury ukládají data pomocí různých bajtů objednávek. "Big-endian" znamená, že nejvýznamnější bajt je na levém konci slova. "Little-endian" znamená, že nejvýznamnější bajt je na pravém konci slova.

Note

Pořadí bajtů sítě můžete převést na pořadí bajtů hostitelského počítače bez načtení hodnoty BitConverter.IsLittleEndian pole předáním 16bitového, 32bitového nebo 64bitového celého čísla metodě IPAddress.HostToNetworkOrder .

Platí pro