다음을 통해 공유


BitConverter 클래스

정의

기본 데이터 형식을 바이트 배열로 변환하고 바이트 배열을 기본 데이터 형식으로 변환합니다.

public ref class BitConverter abstract sealed
public ref class BitConverter sealed
public static class BitConverter
public sealed class BitConverter
type BitConverter = class
Public Class BitConverter
Public NotInheritable Class BitConverter
상속
BitConverter

예제

다음 코드 예제에서는 여러 BitConverter 클래스 메서드의 사용을 보여 줍니다.

// Example of BitConverter class methods.
using namespace System;
int main()
{
   String^ formatter = "{0,25}{1,30}";
   double aDoubl = 0.1111111111111111111;
   float aSingl = 0.1111111111111111111F;
   __int64 aLong = 1111111111111111111;
   int anInt = 1111111111;
   short aShort = 11111;
   __wchar_t aChar = L'*';
   bool aBool = true;
   Console::WriteLine( "This example of methods of the BitConverter class"
   "\ngenerates the following output.\n" );
   Console::WriteLine( formatter, "argument", "byte array" );
   Console::WriteLine( formatter, "--------", "----------" );
   
   // Convert values to Byte arrays and display them.
   Console::WriteLine( formatter, aDoubl, BitConverter::ToString( BitConverter::GetBytes( aDoubl ) ) );
   Console::WriteLine( formatter, aSingl, BitConverter::ToString( BitConverter::GetBytes( aSingl ) ) );
   Console::WriteLine( formatter, aLong, BitConverter::ToString( BitConverter::GetBytes( aLong ) ) );
   Console::WriteLine( formatter, anInt, BitConverter::ToString( BitConverter::GetBytes( anInt ) ) );
   Console::WriteLine( formatter, aShort, BitConverter::ToString( BitConverter::GetBytes( aShort ) ) );
   Console::WriteLine( formatter, aChar, BitConverter::ToString( BitConverter::GetBytes( aChar ) ) );
   Console::WriteLine( formatter, aBool, BitConverter::ToString( BitConverter::GetBytes( aBool ) ) );
}

/*
This example of methods of the BitConverter class
generates the following output.

                 argument                    byte array
                 --------                    ----------
        0.111111111111111       1C-C7-71-1C-C7-71-BC-3F
                0.1111111                   39-8E-E3-3D
      1111111111111111111       C7-71-C4-2B-AB-75-6B-0F
               1111111111                   C7-35-3A-42
                    11111                         67-2B
                        *                         2A-00
                     True                            01
*/
// Example of BitConverter class methods.
using System;

class BitConverterDemo
{
    public static void Main( )
    {
        const string formatter = "{0,25}{1,30}";

        double  aDoubl  = 0.1111111111111111111;
        float   aSingl  = 0.1111111111111111111F;
        long    aLong   = 1111111111111111111;
        int     anInt   = 1111111111;
        short   aShort  = 11111;
        char    aChar   = '*';
        bool    aBool   = true;

        Console.WriteLine(
            "This example of methods of the BitConverter class" +
            "\ngenerates the following output.\n" );
        Console.WriteLine( formatter, "argument", "byte array" );
        Console.WriteLine( formatter, "--------", "----------" );

        // Convert values to Byte arrays and display them.
        Console.WriteLine( formatter, aDoubl,
            BitConverter.ToString( BitConverter.GetBytes( aDoubl ) ) );
        Console.WriteLine( formatter, aSingl,
            BitConverter.ToString( BitConverter.GetBytes( aSingl ) ) );
        Console.WriteLine( formatter, aLong,
            BitConverter.ToString( BitConverter.GetBytes( aLong ) ) );
        Console.WriteLine( formatter, anInt,
            BitConverter.ToString( BitConverter.GetBytes( anInt ) ) );
        Console.WriteLine( formatter, aShort,
            BitConverter.ToString( BitConverter.GetBytes( aShort ) ) );
        Console.WriteLine( formatter, aChar,
            BitConverter.ToString( BitConverter.GetBytes( aChar ) ) );
        Console.WriteLine( formatter, aBool,
            BitConverter.ToString( BitConverter.GetBytes( aBool ) ) );
    }
}

/*
This example of methods of the BitConverter class
generates the following output.

                 argument                    byte array
                 --------                    ----------
        0.111111111111111       1C-C7-71-1C-C7-71-BC-3F
                0.1111111                   39-8E-E3-3D
      1111111111111111111       C7-71-C4-2B-AB-75-6B-0F
               1111111111                   C7-35-3A-42
                    11111                         67-2B
                        *                         2A-00
                     True                            01
*/
open System

let print: obj -> obj -> unit = printfn "%25O%30O"

let aDoubl = 0.1111111111111111111
let aSingl = 0.1111111111111111111f
let aLong = 1111111111111111111L
let anInt = 1111111111
let aShort = 11111s
let aChar = '*'
let aBool = true

printfn "This example of methods of the BitConverter class\ngenerates the following output.\n"
print "argument" "byte array"
print "--------" "----------"

// Convert values to Byte arrays and display them.
print aDoubl (BitConverter.ToString(BitConverter.GetBytes aDoubl))

print aSingl (BitConverter.ToString(BitConverter.GetBytes aSingl))

print aLong (BitConverter.ToString(BitConverter.GetBytes aLong))

print anInt (BitConverter.ToString(BitConverter.GetBytes anInt))

print aShort (BitConverter.ToString(BitConverter.GetBytes aShort))

print aChar (BitConverter.ToString(BitConverter.GetBytes aChar))

print aBool (BitConverter.ToString(BitConverter.GetBytes aBool))


// This example of methods of the BitConverter class
// generates the following output.
//
//                  argument                    byte array
//                  --------                    ----------
//         0.111111111111111       1C-C7-71-1C-C7-71-BC-3F
//                 0.1111111                   39-8E-E3-3D
//       1111111111111111111       C7-71-C4-2B-AB-75-6B-0F
//                1111111111                   C7-35-3A-42
//                     11111                         67-2B
//                         *                         2A-00
//                      True                            01
' Example of BitConverter class methods.
Module BitConverterDemo

    Sub Main( )

        Const formatter As String = "{0,25}{1,30}"
 
        Dim aDoubl      As Double   = 0.1111111111111111111
        Dim aSingl      As Single   = 0.1111111111111111111
        Dim aLong       As Long     = 1111111111111111111
        Dim anInt       As Integer  = 1111111111
        Dim aShort      As Short    = 11111
        Dim aChar       As Char     = "*"c
        Dim aBool       As Boolean  = True

        Console.WriteLine( _
            "This example of methods of the BitConverter class" & _
            vbCrLf & "generates the following output." & vbCrLf )
        Console.WriteLine( formatter, "argument", "Byte array" )
        Console.WriteLine( formatter, "--------", "----------" )

        ' Convert values to Byte arrays and display them.
        Console.WriteLine( formatter, aDoubl, _
            BitConverter.ToString( BitConverter.GetBytes( aDoubl ) ) )
        Console.WriteLine( formatter, aSingl, _
            BitConverter.ToString( BitConverter.GetBytes( aSingl ) ) )
        Console.WriteLine( formatter, aLong, _
            BitConverter.ToString( BitConverter.GetBytes( aLong ) ) )
        Console.WriteLine( formatter, anInt, _
            BitConverter.ToString( BitConverter.GetBytes( anInt ) ) )
        Console.WriteLine( formatter, aShort, _
            BitConverter.ToString( BitConverter.GetBytes( aShort ) ) )
        Console.WriteLine( formatter, aChar, _
            BitConverter.ToString( BitConverter.GetBytes( aChar ) ) )
        Console.WriteLine( formatter, aBool, _
            BitConverter.ToString( BitConverter.GetBytes( aBool ) ) )
    End Sub
End Module

' This example of methods of the BitConverter class
' generates the following output.
' 
'                  argument                    Byte array
'                  --------                    ----------
'         0.111111111111111       1C-C7-71-1C-C7-71-BC-3F
'                 0.1111111                   39-8E-E3-3D
'       1111111111111111111       C7-71-C4-2B-AB-75-6B-0F
'                1111111111                   C7-35-3A-42
'                     11111                         67-2B
'                         *                         2A-00
'                      True                            01

설명

BitConverter 클래스는 기본 형식의 값 형식을 일련의 바이트로 조작하는 데 도움이 됩니다. 바이트는 부호 없는 8비트 정수로 정의됩니다. BitConverter 클래스에는 다음 표와 같이 각 기본 형식을 바이트 배열로 변환하는 정적 메서드가 포함되어 있습니다.

바이트 변환 바이트 변환에서
Boolean GetBytes(Boolean) ToBoolean
Char GetBytes(Char) ToChar
Double GetBytes(Double)
-또는-
DoubleToInt64Bits(Double)
-또는-
DoubleToUInt64Bits(Double)
ToDouble
-또는-
Int64BitsToDouble
-또는-
UInt64BitsToDouble
Half GetBytes(Half)
-또는-
HalfToInt16Bits(Half)
-또는-
HalfToUInt16Bits(Half)
ToHalf
-또는-
Int16BitsToHalf
-또는-
UInt16BitsToHalf
Int16 GetBytes(Int16) ToInt16
Int32 GetBytes(Int32) ToInt32
Int64 GetBytes(Int64) ToInt64
Single GetBytes(Single)
-또는-
SingleToInt32Bits(Single)
-또는-
SingleToUInt32Bits(Single)
ToSingle
-또는-
Int32BitsToSingle
-또는-
UInt32BitsToSingle
UInt16 GetBytes(UInt16) ToUInt16
UInt32 GetBytes(UInt32) ToUInt32
UInt64 GetBytes(UInt64) ToUInt64

BitConverter 메서드를 사용하여 데이터를 왕복하는 경우 GetBytes 오버로드와 ToType 메서드가 동일한 형식을 지정해야 합니다. 다음 예제에서 알 수 있듯이 ToUInt32 메서드를 호출하여 부인 정수를 나타내는 배열을 복원하면 원래 값과 다른 값이 발생할 수 있습니다. 자세한 내용은 서명된 10진수 및 비트 값사용하여 작업하는 것을 참조하세요.

using System;

public class Example
{
   public static void Main()
   {
      int value = -16;
      Byte[] bytes = BitConverter.GetBytes(value);

      // Convert bytes back to int.
      int intValue = BitConverter.ToInt32(bytes, 0);
      Console.WriteLine("{0} = {1}: {2}",
                        value, intValue,
                        value.Equals(intValue) ? "Round-trips" : "Does not round-trip");
      // Convert bytes to UInt32.
      uint uintValue = BitConverter.ToUInt32(bytes, 0);
      Console.WriteLine("{0} = {1}: {2}", value, uintValue,
                        value.Equals(uintValue) ? "Round-trips" : "Does not round-trip");
   }
}
// The example displays the following output:
//       -16 = -16: Round-trips
//       -16 = 4294967280: Does not round-trip
open System

let value = -16
let bytes = BitConverter.GetBytes value

// Convert bytes back to int.
let intValue = BitConverter.ToInt32(bytes, 0)
printfn $"""{value} = {intValue}: {if value.Equals intValue then "Round-trips" else "Does not round-trip"}"""

// Convert bytes to UInt32.
let uintValue = BitConverter.ToUInt32(bytes, 0)
printfn $"""{value} = {uintValue}: {if value.Equals uintValue then "Round-trips" else "Does not round-trip"}"""


// The example displays the following output:
//       -16 = -16: Round-trips
//       -16 = 4294967280: Does not round-trip
Module Example
   Public Sub Main()
      Dim value As Integer = -16
      Dim bytes() As Byte = BitConverter.GetBytes(value) 
      
      ' Convert bytes back to Int32.
      Dim intValue As Integer = BitConverter.ToInt32(bytes, 0)
      Console.WriteLine("{0} = {1}: {2}", 
                        value, intValue, 
                        If(value.Equals(intValue), "Round-trips", "Does not round-trip"))
      ' Convert bytes to UInt32.
      Dim uintValue As UInteger = BitConverter.ToUInt32(bytes, 0)
      Console.WriteLine("{0} = {1}: {2}", value, uintValue, 
                        If(value.Equals(uintValue), "Round-trips", "Does not round-trip"))
   End Sub
End Module
' The example displays the following output:
'       -16 = -16: Round-trips
'       -16 = 4294967280: Does not round-trip

GetBytes 메서드 오버로드에서 반환된 배열의 바이트 순서(뿐만 아니라 DoubleToInt64Bits 메서드에서 반환된 정수의 비트 순서)는 컴퓨터 아키텍처가 little-endian인지 아니면 big-endian인지에 따라 달라집니다. 마찬가지로 배열의 바이트 순서와 ToIntegerValue 메서드 및 ToChar 메서드에서 반환되는 바이트 순서는 컴퓨터 아키텍처가 little-endian 또는 big-endian인지에 따라 달라집니다. 아키텍처의 엔디언성은 IsLittleEndian 속성으로 표시되며, 이 속성은 little-endian 시스템에서 true 반환하고 big-endian 시스템에서 false. little-endian 시스템에서 낮은 순서 바이트는 더 높은 순서 바이트보다 우선합니다. big-endian 시스템에서는 순서가 높은 바이트가 낮은 바이트보다 우선합니다. 다음 표에서는 정수 1,234,567,890(0x499602D2)을 GetBytes(Int32) 메서드에 전달하여 발생하는 바이트 배열의 차이를 보여 줍니다. 바이트는 인덱스 0의 바이트부터 인덱스 3의 바이트 순으로 나열됩니다.

리틀 엔디안 D2-02-96-49
빅엔디안 49-96-02-D2

일부 메서드의 반환 값은 시스템 아키텍처에 따라 달라지므로 컴퓨터 경계를 넘어 바이트 데이터를 전송할 때는 주의해야 합니다.

  • 데이터를 보내고 받는 모든 시스템이 동일한 엔디언을 갖도록 보장되는 경우 데이터에 대해 아무 작업도 수행할 필요가 없습니다.

  • 데이터를 보내고 받는 시스템이 서로 다른 엔디언을 가질 수 있는 경우 항상 특정 순서로 데이터를 전송합니다. 즉, 배열의 바이트 순서는 바이트를 보내기 전에 또는 받은 후에 취소해야 할 수 있습니다. 일반적인 규칙은 네트워크 바이트 순서(big-endian 순서)로 데이터를 전송하는 것입니다. 다음 예제에서는 정수 값을 네트워크 바이트 순서로 보내기 위한 구현을 제공합니다.

    using System;
    
    public class Example
    {
       public static void Main()
       {
          int value = 12345678;
          byte[] bytes = BitConverter.GetBytes(value);
          Console.WriteLine(BitConverter.ToString(bytes));
    
          if (BitConverter.IsLittleEndian)
             Array.Reverse(bytes);
    
          Console.WriteLine(BitConverter.ToString(bytes));
          // Call method to send byte stream across machine boundaries.
    
          // Receive byte stream from beyond machine boundaries.
          Console.WriteLine(BitConverter.ToString(bytes));
          if (BitConverter.IsLittleEndian)
             Array.Reverse(bytes);
    
          Console.WriteLine(BitConverter.ToString(bytes));
          int result = BitConverter.ToInt32(bytes, 0);
          Console.WriteLine("Original value: {0}", value);
          Console.WriteLine("Returned value: {0}", result);
       }
    }
    // The example displays the following output on a little-endian system:
    //       4E-61-BC-00
    //       00-BC-61-4E
    //       00-BC-61-4E
    //       4E-61-BC-00
    //       Original value: 12345678
    //       Returned value: 12345678
    
    open System
    
    let value = 12345678
    let bytes = BitConverter.GetBytes value
    printfn $"{BitConverter.ToString bytes}"
    
    if BitConverter.IsLittleEndian then
        Array.Reverse bytes
    
    printfn $"{BitConverter.ToString bytes}"
    // Call method to send byte stream across machine boundaries.
    
    // Receive byte stream from beyond machine boundaries.
    printfn $"{BitConverter.ToString bytes}"
    if BitConverter.IsLittleEndian then
        Array.Reverse bytes
    
    printfn $"{BitConverter.ToString bytes}"
    let result = BitConverter.ToInt32(bytes, 0)
    
    printfn $"Original value: {value}"
    printfn $"Returned value: {result}"
    
    // The example displays the following output on a little-endian system:
    //       4E-61-BC-00
    //       00-BC-61-4E
    //       00-BC-61-4E
    //       4E-61-BC-00
    //       Original value: 12345678
    //       Returned value: 12345678
    
    Module Example
       Public Sub Main()
          Dim value As Integer = 12345678
          Dim bytes() As Byte = BitConverter.GetBytes(value)
          Console.WriteLine(BitConverter.ToString(bytes))
          
          If BitConverter.IsLittleEndian Then
             Array.Reverse(bytes) 
          End If
          Console.WriteLine(BitConverter.ToString(bytes))
          ' Call method to send byte stream across machine boundaries.
          
          ' Receive byte stream from beyond machine boundaries.
          Console.WriteLine(BitConverter.ToString(bytes))
          If BitConverter.IsLittleEndian Then     
             Array.Reverse(bytes)
          End If   
          Console.WriteLine(BitConverter.ToString(bytes))
          Dim result As Integer = BitConverter.ToInt32(bytes, 0)
          Console.WriteLine("Original value: {0}", value)
          Console.WriteLine("Returned value: {0}", result)
       End Sub
    End Module
    ' The example displays the following output on a little-endian system:
    '       4E-61-BC-00
    '       00-BC-61-4E
    '       00-BC-61-4E
    '       4E-61-BC-00
    '       Original value: 12345678
    '       Returned value: 12345678
    
  • 데이터를 보내고 받는 시스템이 서로 다른 엔디언을 가질 수 있고 전송할 데이터가 서명된 정수로 구성된 경우 IPAddress.HostToNetworkOrder 메서드를 호출하여 데이터를 네트워크 바이트 순서로 변환하고 IPAddress.NetworkToHostOrder 메서드를 호출하여 받는 사람이 요구하는 순서로 변환합니다.

필드

IsLittleEndian

데이터가 이 컴퓨터 아키텍처에 저장되는 바이트 순서("endianness")를 나타냅니다.

메서드

DoubleToInt64Bits(Double)

지정된 배정밀도 부동 소수점 숫자를 부호 있는 64비트 정수로 변환합니다.

DoubleToUInt64Bits(Double)

지정된 배정밀도 부동 소수점 숫자를 부호 없는 64비트 정수로 변환합니다.

GetBytes(Boolean)

지정된 부울 값을 바이트 배열로 반환합니다.

GetBytes(Char)

지정된 유니코드 문자 값을 바이트 배열로 반환합니다.

GetBytes(Double)

지정된 배정밀도 부동 소수점 값을 바이트 배열로 반환합니다.

GetBytes(Half)

지정된 반정밀도 부동 소수점 값을 바이트 배열로 반환합니다.

GetBytes(Int128)

지정된 128비트 부가 정수 값을 바이트 배열로 반환합니다.

GetBytes(Int16)

지정된 16비트 부가 정수 값을 바이트 배열로 반환합니다.

GetBytes(Int32)

지정된 32비트 부속 정수 값을 바이트 배열로 반환합니다.

GetBytes(Int64)

지정된 64비트 부가 정수 값을 바이트 배열로 반환합니다.

GetBytes(Single)

지정된 단정밀도 부동 소수점 값을 바이트 배열로 반환합니다.

GetBytes(UInt128)

지정된 128비트 부호 없는 정수 값을 바이트 배열로 반환합니다.

GetBytes(UInt16)

지정된 16비트 부호 없는 정수 값을 바이트 배열로 반환합니다.

GetBytes(UInt32)

지정된 32비트 부호 없는 정수 값을 바이트 배열로 반환합니다.

GetBytes(UInt64)

지정된 64비트 부호 없는 정수 값을 바이트 배열로 반환합니다.

HalfToInt16Bits(Half)

반정밀도 부동 소수점 값을 16비트 정수로 변환합니다.

HalfToUInt16Bits(Half)

지정된 반정밀도 부동 소수점 숫자를 부호 없는 16비트 정수로 변환합니다.

Int16BitsToHalf(Int16)

지정된 16비트 부속 정수 값을 반정밀도 부동 소수점 값으로 다시 변환합니다.

Int32BitsToSingle(Int32)

지정된 32비트 정수는 단정밀도 부동 소수점 값으로 다시 변환합니다.

Int64BitsToDouble(Int64)

지정된 64비트 부호 있는 정수를 배정밀도 부동 소수점 숫자로 다시 변환합니다.

SingleToInt32Bits(Single)

단정밀도 부동 소수점 값을 정수로 변환합니다.

SingleToUInt32Bits(Single)

지정된 단정밀도 부동 소수점 숫자를 부호 없는 32비트 정수로 변환합니다.

ToBoolean(Byte[], Int32)

바이트 배열의 지정된 위치에 있는 바이트에서 변환된 부울 값을 반환합니다.

ToBoolean(ReadOnlySpan<Byte>)

읽기 전용 바이트 범위를 부울 값으로 변환합니다.

ToChar(Byte[], Int32)

바이트 배열의 지정된 위치에 있는 두 바이트에서 변환된 유니코드 문자를 반환합니다.

ToChar(ReadOnlySpan<Byte>)

읽기 전용 바이트 범위를 문자로 변환합니다.

ToDouble(Byte[], Int32)

바이트 배열의 지정된 위치에 있는 8바이트에서 변환된 배정밀도 부동 소수점 번호를 반환합니다.

ToDouble(ReadOnlySpan<Byte>)

읽기 전용 바이트 범위를 배정밀도 부동 소수점 값으로 변환합니다.

ToHalf(Byte[], Int32)

바이트 배열의 지정된 위치에 있는 두 바이트에서 변환된 반정밀도 부동 소수점 숫자를 반환합니다.

ToHalf(ReadOnlySpan<Byte>)

읽기 전용 바이트 범위를 반정밀도 부동 소수점 값으로 변환합니다.

ToInt128(Byte[], Int32)

바이트 배열의 지정된 위치에 있는 16바이트에서 변환된 128비트 부가 정수 값을 반환합니다.

ToInt128(ReadOnlySpan<Byte>)

읽기 전용 바이트 범위를 128비트 부가 정수로 변환합니다.

ToInt16(Byte[], Int32)

바이트 배열의 지정된 위치에 있는 두 바이트에서 변환된 16비트 부가 정수 값을 반환합니다.

ToInt16(ReadOnlySpan<Byte>)

읽기 전용 바이트 범위를 16비트 부가 정수로 변환합니다.

ToInt32(Byte[], Int32)

바이트 배열의 지정된 위치에 있는 4바이트에서 변환된 32비트 부가 정수 값을 반환합니다.

ToInt32(ReadOnlySpan<Byte>)

읽기 전용 바이트 범위를 32비트 부가 정수로 변환합니다.

ToInt64(Byte[], Int32)

바이트 배열의 지정된 위치에 있는 8바이트에서 변환된 64비트 부가 정수 값을 반환합니다.

ToInt64(ReadOnlySpan<Byte>)

읽기 전용 바이트 범위를 64비트 부가 정수로 변환합니다.

ToSingle(Byte[], Int32)

바이트 배열의 지정된 위치에 있는 4바이트에서 변환된 단정밀도 부동 소수점 숫자를 반환합니다.

ToSingle(ReadOnlySpan<Byte>)

읽기 전용 바이트 범위를 단정밀도 부동 소수점 값으로 변환합니다.

ToString(Byte[])

지정된 바이트 배열의 각 요소의 숫자 값을 해당하는 16진수 문자열 표현으로 변환합니다.

ToString(Byte[], Int32)

지정된 바이트 하위 배열의 각 요소의 숫자 값을 해당하는 16진수 문자열 표현으로 변환합니다.

ToString(Byte[], Int32, Int32)

지정된 바이트 하위 배열의 각 요소의 숫자 값을 해당하는 16진수 문자열 표현으로 변환합니다.

ToUInt128(Byte[], Int32)

바이트 배열의 지정된 위치에서 4바이트로 변환된 128비트 부호 없는 정수 값을 반환합니다.

ToUInt128(ReadOnlySpan<Byte>)

읽기 전용 바이트 범위를 부호 없는 128비트 정수로 변환합니다.

ToUInt16(Byte[], Int32)

바이트 배열의 지정된 위치에 있는 두 바이트에서 변환된 16비트 부호 없는 정수 값을 반환합니다.

ToUInt16(ReadOnlySpan<Byte>)

읽기 전용 바이트 범위를 부호 없는 16비트 정수로 변환합니다.

ToUInt32(Byte[], Int32)

바이트 배열의 지정된 위치에 있는 4바이트에서 변환된 32비트 부호 없는 정수 값을 반환합니다.

ToUInt32(ReadOnlySpan<Byte>)

읽기 전용 바이트 범위를 부호 없는 32비트 정수로 변환합니다.

ToUInt64(Byte[], Int32)

바이트 배열의 지정된 위치에 있는 8바이트에서 변환된 64비트 부호 없는 정수 값을 반환합니다.

ToUInt64(ReadOnlySpan<Byte>)

바이트를 부호 없는 long으로 변환합니다.

TryWriteBytes(Span<Byte>, Boolean)

부울을 바이트 범위로 변환합니다.

TryWriteBytes(Span<Byte>, Char)

문자를 바이트 범위로 변환합니다.

TryWriteBytes(Span<Byte>, Double)

배정밀도 부동 소수점 값을 바이트 범위로 변환합니다.

TryWriteBytes(Span<Byte>, Half)

반정밀도 부동 소수점 값을 바이트 범위로 변환합니다.

TryWriteBytes(Span<Byte>, Int128)

부가된 128비트 정수를 바이트 범위로 변환합니다.

TryWriteBytes(Span<Byte>, Int16)

부가된 16비트 정수를 바이트 범위로 변환합니다.

TryWriteBytes(Span<Byte>, Int32)

부가된 32비트 정수를 바이트 범위로 변환합니다.

TryWriteBytes(Span<Byte>, Int64)

부가된 64비트 정수를 바이트 범위로 변환합니다.

TryWriteBytes(Span<Byte>, Single)

단정밀도 부동 소수점 값을 바이트 범위로 변환합니다.

TryWriteBytes(Span<Byte>, UInt128)

부호 없는 128비트 정수를 바이트 범위로 변환합니다.

TryWriteBytes(Span<Byte>, UInt16)

부호 없는 16비트 정수를 바이트 범위로 변환합니다.

TryWriteBytes(Span<Byte>, UInt32)

부호 없는 32비트 정수를 바이트 범위로 변환합니다.

TryWriteBytes(Span<Byte>, UInt64)

부호 없는 64비트 정수는 바이트 범위로 변환합니다.

UInt16BitsToHalf(UInt16)

지정된 16비트 부호 없는 정수를 반정밀도 부동 소수점 숫자로 변환합니다.

UInt32BitsToSingle(UInt32)

지정된 32비트 부호 없는 정수를 단정밀도 부동 소수점 숫자로 변환합니다.

UInt64BitsToDouble(UInt64)

지정된 64비트 부호 없는 정수를 배정밀도 부동 소수점 숫자로 변환합니다.

적용 대상

추가 정보