Byte 구조체

정의

부호 없는 8비트 정수입니다.

public value class System::Byte : IComparable, IComparable<System::Byte>, IConvertible, IEquatable<System::Byte>, IFormattable
public value class System::Byte : IComparable<System::Byte>, IConvertible, IEquatable<System::Byte>, IParsable<System::Byte>, ISpanParsable<System::Byte>, IUtf8SpanParsable<System::Byte>, System::Numerics::IAdditionOperators<System::Byte, System::Byte, System::Byte>, System::Numerics::IAdditiveIdentity<System::Byte, System::Byte>, System::Numerics::IBinaryInteger<System::Byte>, System::Numerics::IBinaryNumber<System::Byte>, System::Numerics::IBitwiseOperators<System::Byte, System::Byte, System::Byte>, System::Numerics::IComparisonOperators<System::Byte, System::Byte, bool>, System::Numerics::IDecrementOperators<System::Byte>, System::Numerics::IDivisionOperators<System::Byte, System::Byte, System::Byte>, System::Numerics::IEqualityOperators<System::Byte, System::Byte, bool>, System::Numerics::IIncrementOperators<System::Byte>, System::Numerics::IMinMaxValue<System::Byte>, System::Numerics::IModulusOperators<System::Byte, System::Byte, System::Byte>, System::Numerics::IMultiplicativeIdentity<System::Byte, System::Byte>, System::Numerics::IMultiplyOperators<System::Byte, System::Byte, System::Byte>, System::Numerics::INumber<System::Byte>, System::Numerics::INumberBase<System::Byte>, System::Numerics::IShiftOperators<System::Byte, int, System::Byte>, System::Numerics::ISubtractionOperators<System::Byte, System::Byte, System::Byte>, System::Numerics::IUnaryNegationOperators<System::Byte, System::Byte>, System::Numerics::IUnaryPlusOperators<System::Byte, System::Byte>, System::Numerics::IUnsignedNumber<System::Byte>
public value class System::Byte : IComparable, IComparable<System::Byte>, IConvertible, IEquatable<System::Byte>, ISpanFormattable
public value class System::Byte : IComparable<System::Byte>, IConvertible, IEquatable<System::Byte>, IParsable<System::Byte>, ISpanParsable<System::Byte>, System::Numerics::IAdditionOperators<System::Byte, System::Byte, System::Byte>, System::Numerics::IAdditiveIdentity<System::Byte, System::Byte>, System::Numerics::IBinaryInteger<System::Byte>, System::Numerics::IBinaryNumber<System::Byte>, System::Numerics::IBitwiseOperators<System::Byte, System::Byte, System::Byte>, System::Numerics::IComparisonOperators<System::Byte, System::Byte, bool>, System::Numerics::IDecrementOperators<System::Byte>, System::Numerics::IDivisionOperators<System::Byte, System::Byte, System::Byte>, System::Numerics::IEqualityOperators<System::Byte, System::Byte, bool>, System::Numerics::IIncrementOperators<System::Byte>, System::Numerics::IMinMaxValue<System::Byte>, System::Numerics::IModulusOperators<System::Byte, System::Byte, System::Byte>, System::Numerics::IMultiplicativeIdentity<System::Byte, System::Byte>, System::Numerics::IMultiplyOperators<System::Byte, System::Byte, System::Byte>, System::Numerics::INumber<System::Byte>, System::Numerics::INumberBase<System::Byte>, System::Numerics::IShiftOperators<System::Byte, int, System::Byte>, System::Numerics::ISubtractionOperators<System::Byte, System::Byte, System::Byte>, System::Numerics::IUnaryNegationOperators<System::Byte, System::Byte>, System::Numerics::IUnaryPlusOperators<System::Byte, System::Byte>, System::Numerics::IUnsignedNumber<System::Byte>
public value class System::Byte : IComparable, IConvertible, IFormattable
public value class System::Byte : IComparable, IComparable<System::Byte>, IEquatable<System::Byte>, IFormattable
public struct Byte : IComparable, IComparable<byte>, IConvertible, IEquatable<byte>, IFormattable
public readonly struct Byte : IComparable<byte>, IConvertible, IEquatable<byte>, IParsable<byte>, ISpanParsable<byte>, IUtf8SpanParsable<byte>, System.Numerics.IAdditionOperators<byte,byte,byte>, System.Numerics.IAdditiveIdentity<byte,byte>, System.Numerics.IBinaryInteger<byte>, System.Numerics.IBinaryNumber<byte>, System.Numerics.IBitwiseOperators<byte,byte,byte>, System.Numerics.IComparisonOperators<byte,byte,bool>, System.Numerics.IDecrementOperators<byte>, System.Numerics.IDivisionOperators<byte,byte,byte>, System.Numerics.IEqualityOperators<byte,byte,bool>, System.Numerics.IIncrementOperators<byte>, System.Numerics.IMinMaxValue<byte>, System.Numerics.IModulusOperators<byte,byte,byte>, System.Numerics.IMultiplicativeIdentity<byte,byte>, System.Numerics.IMultiplyOperators<byte,byte,byte>, System.Numerics.INumber<byte>, System.Numerics.INumberBase<byte>, System.Numerics.IShiftOperators<byte,int,byte>, System.Numerics.ISubtractionOperators<byte,byte,byte>, System.Numerics.IUnaryNegationOperators<byte,byte>, System.Numerics.IUnaryPlusOperators<byte,byte>, System.Numerics.IUnsignedNumber<byte>
public readonly struct Byte : IComparable, IComparable<byte>, IConvertible, IEquatable<byte>, IFormattable
public readonly struct Byte : IComparable, IComparable<byte>, IConvertible, IEquatable<byte>, ISpanFormattable
public readonly struct Byte : IComparable<byte>, IConvertible, IEquatable<byte>, IParsable<byte>, ISpanParsable<byte>, System.Numerics.IAdditionOperators<byte,byte,byte>, System.Numerics.IAdditiveIdentity<byte,byte>, System.Numerics.IBinaryInteger<byte>, System.Numerics.IBinaryNumber<byte>, System.Numerics.IBitwiseOperators<byte,byte,byte>, System.Numerics.IComparisonOperators<byte,byte,bool>, System.Numerics.IDecrementOperators<byte>, System.Numerics.IDivisionOperators<byte,byte,byte>, System.Numerics.IEqualityOperators<byte,byte,bool>, System.Numerics.IIncrementOperators<byte>, System.Numerics.IMinMaxValue<byte>, System.Numerics.IModulusOperators<byte,byte,byte>, System.Numerics.IMultiplicativeIdentity<byte,byte>, System.Numerics.IMultiplyOperators<byte,byte,byte>, System.Numerics.INumber<byte>, System.Numerics.INumberBase<byte>, System.Numerics.IShiftOperators<byte,int,byte>, System.Numerics.ISubtractionOperators<byte,byte,byte>, System.Numerics.IUnaryNegationOperators<byte,byte>, System.Numerics.IUnaryPlusOperators<byte,byte>, System.Numerics.IUnsignedNumber<byte>
[System.Serializable]
public struct Byte : IComparable, IConvertible, IFormattable
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public struct Byte : IComparable, IComparable<byte>, IConvertible, IEquatable<byte>, IFormattable
public struct Byte : IComparable, IComparable<byte>, IEquatable<byte>, IFormattable
type byte = struct
    interface IConvertible
    interface IFormattable
type byte = struct
    interface IConvertible
    interface IFormattable
    interface IParsable<byte>
    interface ISpanFormattable
    interface ISpanParsable<byte>
    interface IUtf8SpanFormattable
    interface IUtf8SpanParsable<byte>
    interface IAdditionOperators<byte, byte, byte>
    interface IAdditiveIdentity<byte, byte>
    interface IBinaryInteger<byte>
    interface IBinaryNumber<byte>
    interface IBitwiseOperators<byte, byte, byte>
    interface IComparisonOperators<byte, byte, bool>
    interface IEqualityOperators<byte, byte, bool>
    interface IDecrementOperators<byte>
    interface IDivisionOperators<byte, byte, byte>
    interface IIncrementOperators<byte>
    interface IModulusOperators<byte, byte, byte>
    interface IMultiplicativeIdentity<byte, byte>
    interface IMultiplyOperators<byte, byte, byte>
    interface INumber<byte>
    interface INumberBase<byte>
    interface ISubtractionOperators<byte, byte, byte>
    interface IUnaryNegationOperators<byte, byte>
    interface IUnaryPlusOperators<byte, byte>
    interface IShiftOperators<byte, int, byte>
    interface IMinMaxValue<byte>
    interface IUnsignedNumber<byte>
type byte = struct
    interface IConvertible
    interface ISpanFormattable
    interface IFormattable
type byte = struct
    interface IConvertible
    interface IFormattable
    interface IParsable<byte>
    interface ISpanFormattable
    interface ISpanParsable<byte>
    interface IAdditionOperators<byte, byte, byte>
    interface IAdditiveIdentity<byte, byte>
    interface IBinaryInteger<byte>
    interface IBinaryNumber<byte>
    interface IBitwiseOperators<byte, byte, byte>
    interface IComparisonOperators<byte, byte, bool>
    interface IEqualityOperators<byte, byte, bool>
    interface IDecrementOperators<byte>
    interface IDivisionOperators<byte, byte, byte>
    interface IIncrementOperators<byte>
    interface IModulusOperators<byte, byte, byte>
    interface IMultiplicativeIdentity<byte, byte>
    interface IMultiplyOperators<byte, byte, byte>
    interface INumber<byte>
    interface INumberBase<byte>
    interface ISubtractionOperators<byte, byte, byte>
    interface IUnaryNegationOperators<byte, byte>
    interface IUnaryPlusOperators<byte, byte>
    interface IShiftOperators<byte, int, byte>
    interface IMinMaxValue<byte>
    interface IUnsignedNumber<byte>
type byte = struct
    interface IConvertible
    interface IFormattable
    interface IParsable<byte>
    interface ISpanFormattable
    interface ISpanParsable<byte>
    interface IAdditionOperators<byte, byte, byte>
    interface IAdditiveIdentity<byte, byte>
    interface IBinaryInteger<byte>
    interface IBinaryNumber<byte>
    interface IBitwiseOperators<byte, byte, byte>
    interface IComparisonOperators<byte, byte, bool>
    interface IEqualityOperators<byte, byte, bool>
    interface IDecrementOperators<byte>
    interface IDivisionOperators<byte, byte, byte>
    interface IIncrementOperators<byte>
    interface IModulusOperators<byte, byte, byte>
    interface IMultiplicativeIdentity<byte, byte>
    interface IMultiplyOperators<byte, byte, byte>
    interface INumber<byte>
    interface INumberBase<byte>
    interface ISubtractionOperators<byte, byte, byte>
    interface IUnaryNegationOperators<byte, byte>
    interface IUnaryPlusOperators<byte, byte>
    interface IUtf8SpanFormattable
    interface IUtf8SpanParsable<byte>
    interface IShiftOperators<byte, int, byte>
    interface IMinMaxValue<byte>
    interface IUnsignedNumber<byte>
[<System.Serializable>]
type byte = struct
    interface IFormattable
    interface IConvertible
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type byte = struct
    interface IFormattable
    interface IConvertible
type byte = struct
    interface IFormattable
Public Structure Byte
Implements IComparable, IComparable(Of Byte), IConvertible, IEquatable(Of Byte), IFormattable
Public Structure Byte
Implements IAdditionOperators(Of Byte, Byte, Byte), IAdditiveIdentity(Of Byte, Byte), IBinaryInteger(Of Byte), IBinaryNumber(Of Byte), IBitwiseOperators(Of Byte, Byte, Byte), IComparable(Of Byte), IComparisonOperators(Of Byte, Byte, Boolean), IConvertible, IDecrementOperators(Of Byte), IDivisionOperators(Of Byte, Byte, Byte), IEqualityOperators(Of Byte, Byte, Boolean), IEquatable(Of Byte), IIncrementOperators(Of Byte), IMinMaxValue(Of Byte), IModulusOperators(Of Byte, Byte, Byte), IMultiplicativeIdentity(Of Byte, Byte), IMultiplyOperators(Of Byte, Byte, Byte), INumber(Of Byte), INumberBase(Of Byte), IParsable(Of Byte), IShiftOperators(Of Byte, Integer, Byte), ISpanParsable(Of Byte), ISubtractionOperators(Of Byte, Byte, Byte), IUnaryNegationOperators(Of Byte, Byte), IUnaryPlusOperators(Of Byte, Byte), IUnsignedNumber(Of Byte), IUtf8SpanParsable(Of Byte)
Public Structure Byte
Implements IComparable, IComparable(Of Byte), IConvertible, IEquatable(Of Byte), ISpanFormattable
Public Structure Byte
Implements IAdditionOperators(Of Byte, Byte, Byte), IAdditiveIdentity(Of Byte, Byte), IBinaryInteger(Of Byte), IBinaryNumber(Of Byte), IBitwiseOperators(Of Byte, Byte, Byte), IComparable(Of Byte), IComparisonOperators(Of Byte, Byte, Boolean), IConvertible, IDecrementOperators(Of Byte), IDivisionOperators(Of Byte, Byte, Byte), IEqualityOperators(Of Byte, Byte, Boolean), IEquatable(Of Byte), IIncrementOperators(Of Byte), IMinMaxValue(Of Byte), IModulusOperators(Of Byte, Byte, Byte), IMultiplicativeIdentity(Of Byte, Byte), IMultiplyOperators(Of Byte, Byte, Byte), INumber(Of Byte), INumberBase(Of Byte), IParsable(Of Byte), IShiftOperators(Of Byte, Integer, Byte), ISpanParsable(Of Byte), ISubtractionOperators(Of Byte, Byte, Byte), IUnaryNegationOperators(Of Byte, Byte), IUnaryPlusOperators(Of Byte, Byte), IUnsignedNumber(Of Byte)
Public Structure Byte
Implements IComparable, IConvertible, IFormattable
Public Structure Byte
Implements IComparable, IComparable(Of Byte), IEquatable(Of Byte), IFormattable
상속
특성
구현
IComparable IComparable<Byte> IConvertible IEquatable<Byte> IFormattable IComparable<TSelf> IEquatable<TSelf> IParsable<Byte> IParsable<TSelf> ISpanFormattable ISpanParsable<Byte> ISpanParsable<TSelf> IUtf8SpanFormattable IUtf8SpanParsable<Byte> IUtf8SpanParsable<TSelf> IAdditionOperators<Byte,Byte,Byte> IAdditionOperators<TSelf,TSelf,TSelf> IAdditiveIdentity<Byte,Byte> IAdditiveIdentity<TSelf,TSelf> IBinaryInteger<Byte> IBinaryNumber<Byte> IBinaryNumber<TSelf> IBitwiseOperators<Byte,Byte,Byte> IBitwiseOperators<TSelf,TSelf,TSelf> IComparisonOperators<Byte,Byte,Boolean> IComparisonOperators<TSelf,TSelf,Boolean> IDecrementOperators<Byte> IDecrementOperators<TSelf> IDivisionOperators<Byte,Byte,Byte> IDivisionOperators<TSelf,TSelf,TSelf> IEqualityOperators<Byte,Byte,Boolean> IEqualityOperators<TSelf,TOther,TResult> IEqualityOperators<TSelf,TSelf,Boolean> IIncrementOperators<Byte> IIncrementOperators<TSelf> IMinMaxValue<Byte> IModulusOperators<Byte,Byte,Byte> IModulusOperators<TSelf,TSelf,TSelf> IMultiplicativeIdentity<Byte,Byte> IMultiplicativeIdentity<TSelf,TSelf> IMultiplyOperators<Byte,Byte,Byte> IMultiplyOperators<TSelf,TSelf,TSelf> INumber<Byte> INumber<TSelf> INumberBase<Byte> INumberBase<TSelf> IShiftOperators<Byte,Int32,Byte> IShiftOperators<TSelf,Int32,TSelf> ISubtractionOperators<Byte,Byte,Byte> ISubtractionOperators<TSelf,TSelf,TSelf> IUnaryNegationOperators<Byte,Byte> IUnaryNegationOperators<TSelf,TSelf> IUnaryPlusOperators<Byte,Byte> IUnaryPlusOperators<TSelf,TSelf> IUnsignedNumber<Byte>

설명

Byte 0(Byte.MinValue 상수로 표시됨)에서 255(Byte.MaxValue 상수로 표현됨)까지의 값을 가진 부호 없는 정수를 나타내는 변경할 수 없는 값 형식입니다. .NET에는 -128 127까지의 값을 나타내는 부가적인 8비트 정수 값 형식(SByte)도 포함되어 있습니다.

바이트 값 인스턴스화

다음과 같은 여러 가지 방법으로 Byte 값을 인스턴스화할 수 있습니다.

  • Byte 변수를 선언하고 Byte 데이터 형식의 범위 내에 있는 리터럴 정수 값을 할당할 수 있습니다. 다음 예제에서는 두 개의 Byte 변수를 선언하고 이러한 방식으로 값을 할당합니다.

    byte value1 = 64;
    byte value2 = 255;
    
    let value1 = 64uy
    let value2 = 255uy
    
    Dim value1 As Byte = 64
    Dim value2 As Byte = 255
    
  • 바이트가 아닌 숫자 값을 바이트에 할당할 수 있습니다. 축소 변환이므로 C# 및 F#의 캐스트 연산자 또는 Option Strict 있는 경우 Visual Basic의 변환 메서드가 필요합니다. 비바이트 값이 소수 구성 요소를 포함하는 Single, Double또는 Decimal 값인 경우 해당 소수 부분의 처리는 변환을 수행하는 컴파일러에 따라 달라집니다. 다음 예제에서는 Byte 변수에 여러 숫자 값을 할당합니다.

    int int1 = 128;
    try
    {
        byte value1 = (byte)int1;
        Console.WriteLine(value1);
    }
    catch (OverflowException)
    {
        Console.WriteLine($"{int1} is out of range of a byte.");
    }
    
    double dbl2 = 3.997;
    try
    {
        byte value2 = (byte)dbl2;
        Console.WriteLine(value2);
    }
    catch (OverflowException)
    {
        Console.WriteLine($"{dbl2} is out of range of a byte.");
    }
    // The example displays the following output:
    //       128
    //       3
    
    let int1 = 128
    try
        let value1 = byte int1
        printfn $"{value1}"
    with :? OverflowException ->
        printfn $"{int1} is out of range of a byte."
    
    let dbl2 = 3.997
    try
        let value2 = byte dbl2
        printfn $"{value2}"
    with :? OverflowException ->
        printfn $"{dbl2} is out of range of a byte."
    
    // The example displays the following output:
    //       128
    //       3
    
    Dim int1 As Integer = 128
    Try
        Dim value1 As Byte = CByte(int1)
        Console.WriteLine(value1)
    Catch e As OverflowException
        Console.WriteLine("{0} is out of range of a byte.", int1)
    End Try
    
    Dim dbl2 As Double = 3.997
    Try
        Dim value2 As Byte = CByte(dbl2)
        Console.WriteLine(value2)
    Catch e As OverflowException
        Console.WriteLine("{0} is out of range of a byte.", dbl2)
    End Try
    ' The example displays the following output:
    '       128
    '       4
    
  • Convert 클래스의 메서드를 호출하여 지원되는 모든 형식을 Byte 값으로 변환할 수 있습니다. Byte IConvertible 인터페이스를 지원하므로 가능합니다. 다음 예제에서는 Int32 값 배열을 Byte 값으로 변환하는 방법을 보여 줍니다.

    int[] numbers = { Int32.MinValue, -1, 0, 121, 340, Int32.MaxValue };
    byte result;
    foreach (int number in numbers)
    {
       try {
          result = Convert.ToByte(number);
          Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
                            number.GetType().Name, number,
                            result.GetType().Name, result);
       }
       catch (OverflowException) {
          Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
                            number.GetType().Name, number);
       }
    }
    // The example displays the following output:
    //       The Int32 value -2147483648 is outside the range of the Byte type.
    //       The Int32 value -1 is outside the range of the Byte type.
    //       Converted the Int32 value 0 to the Byte value 0.
    //       Converted the Int32 value 121 to the Byte value 121.
    //       The Int32 value 340 is outside the range of the Byte type.
    //       The Int32 value 2147483647 is outside the range of the Byte type.
    
    let numbers = [| Int32.MinValue; -1; 0; 121; 340; Int32.MaxValue |]
    for number in numbers do
        try
            let result = Convert.ToByte number
            printfn $"Converted the {number.GetType().Name} value {number} to the {result.GetType().Name} value {result}."
        with :? OverflowException ->
            printfn $"The {number.GetType().Name} value {number} is outside the range of the Byte type."
    // The example displays the following output:
    //       The Int32 value -2147483648 is outside the range of the Byte type.
    //       The Int32 value -1 is outside the range of the Byte type.
    //       Converted the Int32 value 0 to the Byte value 0.
    //       Converted the Int32 value 121 to the Byte value 121.
    //       The Int32 value 340 is outside the range of the Byte type.
    //       The Int32 value 2147483647 is outside the range of the Byte type.
    
    Dim numbers() As Integer = {Int32.MinValue, -1, 0, 121, 340, Int32.MaxValue}
    Dim result As Byte
    For Each number As Integer In numbers
        Try
            result = Convert.ToByte(number)
            Console.WriteLine("Converted the {0} value {1} to the {2} value {3}.",
                          number.GetType().Name, number,
                          result.GetType().Name, result)
        Catch e As OverflowException
            Console.WriteLine("The {0} value {1} is outside the range of the Byte type.",
                          number.GetType().Name, number)
        End Try
    Next
    ' The example displays the following output:
    '       The Int32 value -2147483648 is outside the range of the Byte type.
    '       The Int32 value -1 is outside the range of the Byte type.
    '       Converted the Int32 value 0 to the Byte value 0.
    '       Converted the Int32 value 121 to the Byte value 121.
    '       The Int32 value 340 is outside the range of the Byte type.
    '       The Int32 value 2147483647 is outside the range of the Byte type.
    
  • Parse 또는 TryParse 메서드를 호출하여 Byte 값의 문자열 표현을 Byte변환할 수 있습니다. 문자열은 10진수 또는 16진수를 포함할 수 있습니다. 다음 예제에서는 10진수 및 16진수 문자열을 모두 사용하여 구문 분석 작업을 보여 줍니다.

    string string1 = "244";
    try
    {
        byte byte1 = Byte.Parse(string1);
        Console.WriteLine(byte1);
    }
    catch (OverflowException)
    {
        Console.WriteLine($"'{string1}' is out of range of a byte.");
    }
    catch (FormatException)
    {
        Console.WriteLine($"'{string1}' is out of range of a byte.");
    }
    
    string string2 = "F9";
    try
    {
        byte byte2 = Byte.Parse(string2,
                                System.Globalization.NumberStyles.HexNumber);
        Console.WriteLine(byte2);
    }
    catch (OverflowException)
    {
        Console.WriteLine($"'{string2}' is out of range of a byte.");
    }
    catch (FormatException)
    {
        Console.WriteLine($"'{string2}' is out of range of a byte.");
    }
    // The example displays the following output:
    //       244
    //       249
    
    let string1 = "244"
    try
        let byte1 = Byte.Parse string1
        printfn $"{byte1}" 
    with
    | :? OverflowException ->
        printfn $"'{string1}' is out of range of a byte."
    | :? FormatException ->
        printfn $"'{string1}' is out of range of a byte."
    
    let string2 = "F9"
    try
        let byte2 = Byte.Parse(string2, System.Globalization.NumberStyles.HexNumber)
        printfn $"{byte2}"
    with
    | :? OverflowException ->
        printfn $"'{string2}' is out of range of a byte."
    | :? FormatException ->
        printfn $"'{string2}' is out of range of a byte."
    
    // The example displays the following output:
    //       244
    //       249
    
    Dim string1 As String = "244"
    Try
        Dim byte1 As Byte = Byte.Parse(string1)
        Console.WriteLine(byte1)
    Catch e As OverflowException
        Console.WriteLine("'{0}' is out of range of a byte.", string1)
    Catch e As FormatException
        Console.WriteLine("'{0}' is out of range of a byte.", string1)
    End Try
    
    Dim string2 As String = "F9"
    Try
        Dim byte2 As Byte = Byte.Parse(string2,
                               System.Globalization.NumberStyles.HexNumber)
        Console.WriteLine(byte2)
    Catch e As OverflowException
        Console.WriteLine("'{0}' is out of range of a byte.", string2)
    Catch e As FormatException
        Console.WriteLine("'{0}' is out of range of a byte.", string2)
    End Try
    ' The example displays the following output:
    '       244
    '       249
    

바이트 값에 대한 작업 수행

Byte 형식은 더하기, 빼기, 나누기, 곱하기, 빼기, 부정 및 단항 부정과 같은 표준 수학 연산을 지원합니다. 다른 정수 계열 형식과 마찬가지로 Byte 형식은 비트 AND, OR, XOR, 왼쪽 시프트 및 오른쪽 시프트 연산자도 지원합니다.

표준 숫자 연산자를 사용하여 두 Byte 값을 비교하거나 CompareTo 또는 Equals 메서드를 호출할 수 있습니다.

또한 Math 클래스의 멤버를 호출하여 숫자의 절대값 가져오기, 정수 나누기에서 몫 및 나머지 계산, 두 정수의 최대값 또는 최소값 결정, 숫자 기호 가져오기 및 숫자 반올림 등 다양한 숫자 연산을 수행할 수 있습니다.

바이트를 문자열로 표현

Byte 형식은 표준 및 사용자 지정 숫자 형식 문자열을 완전히 지원합니다. (자세한 내용은 형식, 표준 숫자 서식 문자열 및 사용자 지정 숫자 서식 문자열 참조하세요.) 그러나 가장 일반적으로 바이트 값은 추가 서식 없이 1자리에서 3자리 값으로 표현되거나 두 자리 16진수 값으로 표시됩니다.

Byte 값을 선행 0이 없는 정수 문자열로 서식을 지정하려면 매개 변수가 없는 ToString() 메서드를 호출할 수 있습니다. "D" 형식 지정자를 사용하여 문자열 표현에 지정된 수의 선행 0을 포함할 수도 있습니다. "X" 형식 지정자를 사용하여 Byte 값을 16진수 문자열로 나타낼 수 있습니다. 다음 예제에서는 이러한 세 가지 방법으로 Byte 값 배열의 요소 서식을 지정합니다.

byte[] numbers = [ 0, 16, 104, 213 ];
foreach (byte number in numbers)
{
    // Display value using default formatting.
    Console.Write("{0,-3}  -->   ", number.ToString());
    // Display value with 3 digits and leading zeros.
    Console.Write(number.ToString("D3") + "   ");
    // Display value with hexadecimal.
    Console.Write(number.ToString("X2") + "   ");
    // Display value with four hexadecimal digits.
    Console.WriteLine(number.ToString("X4"));
}
// The example displays the following output:
//       0    -->   000   00   0000
//       16   -->   016   10   0010
//       104  -->   104   68   0068
//       213  -->   213   D5   00D5
let numbers = [| 0; 16; 104; 213 |]
for number in numbers do
    // Display value using default formatting.
    number.ToString()
    |> printf "%-3s  -->   "

    // Display value with 3 digits and leading zeros.
    number.ToString "D3"
    |> printf "%s   "
    
    // Display value with hexadecimal.
    number.ToString "X2"
    |> printf "%s   "
    
    // Display value with four hexadecimal digits.
    number.ToString "X4"
    |> printfn "%s"

// The example displays the following output:
//       0    -->   000   00   0000
//       16   -->   016   10   0010
//       104  -->   104   68   0068
//       213  -->   213   D5   00D5
Dim numbers() As Byte = {0, 16, 104, 213}
For Each number As Byte In numbers
    ' Display value using default formatting.
    Console.Write("{0,-3}  -->   ", number.ToString())
    ' Display value with 3 digits and leading zeros.
    Console.Write(number.ToString("D3") + "   ")
    ' Display value with hexadecimal.
    Console.Write(number.ToString("X2") + "   ")
    ' Display value with four hexadecimal digits.
    Console.WriteLine(number.ToString("X4"))
Next
' The example displays the following output:
'       0    -->   000   00   0000
'       16   -->   016   10   0010
'       104  -->   104   68   0068
'       213  -->   213   D5   00D5

Byte 메서드를 호출하고 밑을 메서드의 두 번째 매개 변수로 제공하여 ToString(Byte, Int32) 값을 이진, 8진수, 10진수 또는 16진수 문자열로 서식을 지정할 수도 있습니다. 다음 예제에서는 바이트 값 배열의 이진, 8진수 및 16진수 표현을 표시하기 위해 이 메서드를 호출합니다.

byte[] numbers = { 0, 16, 104, 213 };
Console.WriteLine("{0}   {1,8}   {2,5}   {3,5}",
                  "Value", "Binary", "Octal", "Hex");
foreach (byte number in numbers)
{
    Console.WriteLine("{0,5}   {1,8}   {2,5}   {3,5}",
                      number, Convert.ToString(number, 2),
                      Convert.ToString(number, 8),
                      Convert.ToString(number, 16));
}
// The example displays the following output:
//       Value     Binary   Octal     Hex
//           0          0       0       0
//          16      10000      20      10
//         104    1101000     150      68
//         213   11010101     325      d5
let numbers = [| 0; 16; 104; 213 |]
printfn "%s   %8s   %5s   %5s" "Value" "Binary" "Octal" "Hex"
for number in numbers do
    printfn $"%5i{number}   %8s{Convert.ToString(number, 2)}   %5s{Convert.ToString(number, 8)}   %5s{Convert.ToString(number, 16)}"
                    
// The example displays the following output:
//       Value     Binary   Octal     Hex
//           0          0       0       0
//          16      10000      20      10
//         104    1101000     150      68
//         213   11010101     325      d5
Dim numbers() As Byte = {0, 16, 104, 213}
Console.WriteLine("{0}   {1,8}   {2,5}   {3,5}",
                "Value", "Binary", "Octal", "Hex")
For Each number As Byte In numbers
    Console.WriteLine("{0,5}   {1,8}   {2,5}   {3,5}",
                   number, Convert.ToString(number, 2),
                   Convert.ToString(number, 8),
                   Convert.ToString(number, 16))
Next
' The example displays the following output:
'       Value     Binary   Octal     Hex
'           0          0       0       0
'          16      10000      20      10
'         104    1101000     150      68
'         213   11010101     325      d5

10진수가 아닌 바이트 값 사용

개별 바이트를 10진수 값으로 사용하는 것 외에도 바이트 값을 사용하여 비트 연산을 수행하거나 바이트 배열 또는 바이트 값의 이진 또는 16진수 표현으로 작업할 수 있습니다. 예를 들어 BitConverter.GetBytes 메서드의 오버로드는 각 기본 데이터 형식을 바이트 배열로 변환할 수 있으며 BigInteger.ToByteArray 메서드는 BigInteger 값을 바이트 배열로 변환합니다.

Byte 값은 부호 비트 없이 크기로만 8비트로 표시됩니다. 이는 Byte 값에 대해 비트 연산을 수행하거나 개별 비트로 작업할 때 유의해야 합니다. 소수점이 아닌 두 값에 대해 숫자, 부울 또는 비교 작업을 수행하려면 두 값 모두 동일한 표현을 사용해야 합니다.

Byte 값에 대해 작업을 수행하는 경우 값은 동일한 표현을 공유하므로 결과가 정확합니다. 다음 예제에서는 Byte 값의 가장 낮은 순서 비트를 마스크하여 짝수인지 확인합니다.

using System;
using System.Globalization;

public class Example
{
   public static void Main()
   {
      string[] values = [ Convert.ToString(12, 16),
                          Convert.ToString(123, 16),
                          Convert.ToString(245, 16) ];

      byte mask = 0xFE;
      foreach (string value in values) {
         Byte byteValue = Byte.Parse(value, NumberStyles.AllowHexSpecifier);
         Console.WriteLine($"{byteValue} And {mask} = {byteValue & mask}");
      }
   }
}
// The example displays the following output:
//       12 And 254 = 12
//       123 And 254 = 122
//       245 And 254 = 244
open System
open System.Globalization

let values = 
    [ Convert.ToString(12, 16)
      Convert.ToString(123, 16)
      Convert.ToString(245, 16) ]

let mask = 0xFEuy
for value in values do
    let byteValue = Byte.Parse(value, NumberStyles.AllowHexSpecifier)
    printfn $"{byteValue} And {mask} = {byteValue &&& mask}"
                    

// The example displays the following output:
//       12 And 254 = 12
//       123 And 254 = 122
//       245 And 254 = 244
Imports System.Globalization

Module Example1
    Public Sub Main()
        Dim values() As String = {Convert.ToString(12, 16),
                                 Convert.ToString(123, 16),
                                 Convert.ToString(245, 16)}

        Dim mask As Byte = &HFE
        For Each value As String In values
            Dim byteValue As Byte = Byte.Parse(value, NumberStyles.AllowHexSpecifier)
            Console.WriteLine("{0} And {1} = {2}", byteValue, mask,
                           byteValue And mask)
        Next
    End Sub
End Module
' The example displays the following output:
'       12 And 254 = 12
'       123 And 254 = 122
'       245 And 254 = 244

반면에 부호 없는 비트와 부호 있는 비트를 모두 사용하는 경우 비트 연산은 SByte 값이 양수 값에 대해 부호 및 크기 표현을 사용하고 음수 값에 대해 두 개의 보수 표현을 사용한다는 사실 때문에 복잡해집니다. 의미 있는 비트 연산을 수행하려면 값을 두 개의 동등한 표현으로 변환해야 하며 부호 비트에 대한 정보는 보존되어야 합니다. 다음 예제에서는 부호 있는 8비트 및 부호 없는 값 배열의 비트 2와 4를 마스킹합니다.

using System;
using System.Collections.Generic;
using System.Globalization;

public struct ByteString
{
    public string Value;
    public int Sign;
}

public class BSExample1
{
    public static void Main()
    {
        ByteString[] values = CreateArray(-15, 123, 245);

        byte mask = 0x14;        // Mask all bits but 2 and 4.

        foreach (ByteString strValue in values)
        {
            byte byteValue = Byte.Parse(strValue.Value, NumberStyles.AllowHexSpecifier);
            Console.WriteLine($"{strValue.Sign * byteValue} ({Convert.ToString(byteValue, 2)}) And {mask} ({Convert.ToString(mask, 2)}) = {(strValue.Sign & Math.Sign(mask)) * (byteValue & mask)} ({Convert.ToString(byteValue & mask, 2)})");
        }
    }

    private static ByteString[] CreateArray(params int[] values)
    {
        List<ByteString> byteStrings = new();

        foreach (object value in values)
        {
            ByteString temp = new ByteString();
            int sign = Math.Sign((int)value);
            temp.Sign = sign;

            // Change two's complement to magnitude-only representation.
            temp.Value = Convert.ToString(((int)value) * sign, 16);

            byteStrings.Add(temp);
        }
        return byteStrings.ToArray();
    }
}
// The example displays the following output:
//       -15 (1111) And 20 (10100) = 4 (100)
//       123 (1111011) And 20 (10100) = 16 (10000)
//       245 (11110101) And 20 (10100) = 20 (10100)
open System
open System.Collections.Generic
open System.Globalization

[<Struct>]
type ByteString =
    { Sign: int
      Value: string }

let createArray values =
    [ for value in values do
        let sign = sign value
        { Sign = sign
         // Change two's complement to magnitude-only representation.
          Value = Convert.ToString(value * sign, 16)} ]


let values = createArray [ -15; 123; 245 ]

let mask = 0x14uy        // Mask all bits but 2 and 4.

for strValue in values do
    let byteValue = Byte.Parse(strValue.Value, NumberStyles.AllowHexSpecifier)
    printfn $"{strValue.Sign * int byteValue} ({Convert.ToString(byteValue, 2)}) And {mask} ({Convert.ToString(mask, 2)}) = {(strValue.Sign &&& (int mask |> sign)) * int (byteValue &&& mask)} ({Convert.ToString(byteValue &&& mask, 2)})"

// The example displays the following output:
//       -15 (1111) And 20 (10100) = 4 (100)
//       123 (1111011) And 20 (10100) = 16 (10000)
//       245 (11110101) And 20 (10100) = 20 (10100)
Imports System.Collections.Generic
Imports System.Globalization

Public Structure ByteString
   Public Value As String
   Public Sign As Integer
End Structure

Module Example2
    Public Sub Main()
        Dim values() As ByteString = CreateArray(-15, 123, 245)

        Dim mask As Byte = &H14        ' Mask all bits but 2 and 4.

        For Each strValue As ByteString In values
            Dim byteValue As Byte = Byte.Parse(strValue.Value, NumberStyles.AllowHexSpecifier)
            Console.WriteLine("{0} ({1}) And {2} ({3}) = {4} ({5})",
                           strValue.Sign * byteValue,
                           Convert.ToString(byteValue, 2),
                           mask, Convert.ToString(mask, 2),
                           (strValue.Sign And Math.Sign(mask)) * (byteValue And mask),
                           Convert.ToString(byteValue And mask, 2))
        Next
    End Sub

    Private Function CreateArray(ParamArray values() As Object) As ByteString()
        Dim byteStrings As New List(Of ByteString)
        For Each value As Object In values
            Dim temp As New ByteString()
            Dim sign As Integer = Math.Sign(value)
            temp.Sign = sign
            ' Change two's complement to magnitude-only representation.
            value = value * sign

            temp.Value = Convert.ToString(value, 16)
            byteStrings.Add(temp)
        Next
        Return byteStrings.ToArray()
    End Function
End Module
' The example displays the following output:
'       -15 (1111) And 20 (10100) = 4 (100)
'       123 (1111011) And 20 (10100) = 16 (10000)
'       245 (11110101) And 20 (10100) = 20 (10100)

필드

Name Description
MaxValue

의 가능한 가장 큰 값을 나타냅니다 Byte. 이 필드는 상수입니다.

MinValue

가능한 가장 작은 값을 Byte나타냅니다. 이 필드는 상수입니다.

메서드

Name Description
Clamp(Byte, Byte, Byte)

값을 포괄 최소값 및 최대값으로 고정합니다.

CompareTo(Byte)

이 인스턴스를 지정된 8비트 부호 없는 정수와 비교하고 상대 값의 표시를 반환합니다.

CompareTo(Object)

이 인스턴스를 지정된 개체와 비교하고 상대 값의 표시를 반환합니다.

CreateChecked<TOther>(TOther)

현재 형식의 표현 가능한 범위를 벗어나는 값에 대해 오버플로 예외를 throw하여 값에서 현재 형식의 인스턴스를 만듭니다.

CreateSaturating<TOther>(TOther)

현재 형식의 표현 가능한 범위를 벗어나는 모든 값을 채도하여 값에서 현재 형식의 인스턴스를 만듭니다.

CreateTruncating<TOther>(TOther)

현재 형식의 표현 가능한 범위를 벗어나는 값을 잘라내어 값에서 현재 형식의 인스턴스를 만듭니다.

DivRem(Byte, Byte)

두 값의 몫과 나머지를 계산합니다.

Equals(Byte)

이 인스턴스와 지정된 Byte 개체가 동일한 값을 나타내는지 여부를 나타내는 값을 반환합니다.

Equals(Object)

이 인스턴스가 지정된 개체와 같은지 여부를 나타내는 값을 반환합니다.

GetHashCode()

이 인스턴스의 해시 코드를 반환합니다.

GetTypeCode()

for 값 형식을 TypeCode 반환합니다 Byte.

IsEvenInteger(Byte)

값이 짝수 정수인지 여부를 확인합니다.

IsOddInteger(Byte)

값이 홀수 정수인지 여부를 결정합니다.

IsPow2(Byte)

값이 2의 힘인지 확인합니다.

LeadingZeroCount(Byte)

값의 선행 0 수를 계산합니다.

Log10(Byte)

부호 없는 8비트 정수입니다.

Log2(Byte)

값의 log2를 계산합니다.

Max(Byte, Byte)

두 값을 더 큰 컴퓨팅과 비교합니다.

Min(Byte, Byte)

두 값을 더 작은 컴퓨팅과 비교합니다.

Parse(ReadOnlySpan<Byte>, IFormatProvider)

UTF-8 문자의 범위를 값으로 구문 분석합니다.

Parse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider)

UTF-8 문자의 범위를 값으로 구문 분석합니다.

Parse(ReadOnlySpan<Char>, IFormatProvider)

문자 범위를 값으로 구문 분석합니다.

Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider)

지정된 스타일 및 문화권별 형식의 숫자 범위 표현을 해당하는 형식으로 Byte 변환합니다.

Parse(String, IFormatProvider)

지정된 문화권별 형식의 숫자 문자열 표현을 해당하는 형식으로 Byte 변환합니다.

Parse(String, NumberStyles, IFormatProvider)

지정된 스타일 및 문화권별 형식의 숫자의 문자열 표현을 해당하는 형식으로 Byte 변환합니다.

Parse(String, NumberStyles)

지정된 스타일의 숫자 문자열 표현을 해당하는 값으로 Byte 변환합니다.

Parse(String)

숫자의 문자열 표현을 해당하는 값으로 Byte 변환합니다.

PopCount(Byte)

값에 설정된 비트 수를 계산합니다.

RotateLeft(Byte, Int32)

지정된 양만큼 남은 값을 회전합니다.

RotateRight(Byte, Int32)

값을 지정된 양만큼 오른쪽으로 회전합니다.

Sign(Byte)

값의 부호를 계산합니다.

ToString()

현재 Byte 개체의 값을 해당하는 문자열 표현으로 변환합니다.

ToString(IFormatProvider)

지정된 문화권별 서식 정보를 사용하여 현재 Byte 개체의 숫자 값을 해당하는 문자열 표현으로 변환합니다.

ToString(String, IFormatProvider)

지정된 형식 및 문화권별 서식 정보를 사용하여 현재 Byte 개체의 값을 해당하는 문자열 표현으로 변환합니다.

ToString(String)

지정된 형식을 사용하여 현재 Byte 개체의 값을 해당하는 문자열 표현으로 변환합니다.

TrailingZeroCount(Byte)

값의 후행 0 수를 계산합니다.

TryFormat(Span<Byte>, Int32, ReadOnlySpan<Char>, IFormatProvider)

현재 인스턴스의 값을 제공된 바이트 범위로 UTF-8로 서식을 지정하려고 시도합니다.

TryFormat(Span<Char>, Int32, ReadOnlySpan<Char>, IFormatProvider)

현재 8비트 부호 없는 정수 인스턴스의 값을 제공된 문자 범위로 서식을 지정하려고 시도합니다.

TryParse(ReadOnlySpan<Byte>, Byte)

숫자의 문자열 표현을 포함하는 UTF-8 문자 범위를 해당하는 8비트 부호 없는 정수로 변환하려고 시도합니다.

TryParse(ReadOnlySpan<Byte>, IFormatProvider, Byte)

UTF-8 문자의 범위를 값으로 구문 분석하려고 시도합니다.

TryParse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider, Byte)

UTF-8 문자의 범위를 값으로 구문 분석하려고 시도합니다.

TryParse(ReadOnlySpan<Char>, Byte)

숫자의 범위 표현을 해당하는 값으로 Byte 변환하려고 시도하고 변환에 성공했는지 여부를 나타내는 값을 반환합니다.

TryParse(ReadOnlySpan<Char>, IFormatProvider, Byte)

문자 범위를 값으로 구문 분석하려고 시도합니다.

TryParse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider, Byte)

지정된 스타일 및 문화권별 형식의 숫자 범위 표현을 해당하는 형식으로 Byte 변환합니다. 반환 값은 변환이 성공했는지 아니면 실패했는지를 나타냅니다.

TryParse(String, Byte)

숫자의 문자열 표현을 해당하는 값으로 Byte 변환하려고 시도하고 변환이 성공했는지 여부를 나타내는 값을 반환합니다.

TryParse(String, IFormatProvider, Byte)

문자열을 값으로 구문 분석하려고 시도합니다.

TryParse(String, NumberStyles, IFormatProvider, Byte)

지정된 스타일 및 문화권별 형식의 숫자의 문자열 표현을 해당하는 형식으로 Byte 변환합니다. 반환 값은 변환이 성공했는지 아니면 실패했는지를 나타냅니다.

명시적 인터페이스 구현

Name Description
IAdditionOperators<Byte,Byte,Byte>.Addition(Byte, Byte)

합계를 계산하기 위해 두 값을 함께 추가합니다.

IAdditionOperators<Byte,Byte,Byte>.CheckedAddition(Byte, Byte)

합계를 계산하기 위해 두 값을 함께 추가합니다.

IAdditiveIdentity<Byte,Byte>.AdditiveIdentity

현재 형식의 추가 ID를 가져옵니다.

IBinaryInteger<Byte>.GetByteCount()

의 일부로 TryWriteLittleEndian(Span<Byte>, Int32)기록될 바이트 수를 가져옵니다.

IBinaryInteger<Byte>.GetShortestBitLength()

현재 값에 대한 가장 짧은 두 개의 보수 표현의 길이(비트)를 가져옵니다.

IBinaryInteger<Byte>.TryReadBigEndian(ReadOnlySpan<Byte>, Boolean, Byte)

부호 없는 8비트 정수입니다.

IBinaryInteger<Byte>.TryReadLittleEndian(ReadOnlySpan<Byte>, Boolean, Byte)

부호 없는 8비트 정수입니다.

IBinaryInteger<Byte>.TryWriteBigEndian(Span<Byte>, Int32)

현재 값을 big-endian 형식으로 지정된 범위에 쓰려고 합니다.

IBinaryInteger<Byte>.TryWriteLittleEndian(Span<Byte>, Int32)

현재 값을 little-endian 형식으로 지정된 범위에 쓰려고 합니다.

IBinaryNumber<Byte>.AllBitsSet

모든 비트가 설정된 이진 형식의 인스턴스를 가져옵니다.

IBitwiseOperators<Byte,Byte,Byte>.BitwiseAnd(Byte, Byte)

두 값의 비트 및 값을 계산합니다.

IBitwiseOperators<Byte,Byte,Byte>.BitwiseOr(Byte, Byte)

비트 또는 두 값을 계산합니다.

IBitwiseOperators<Byte,Byte,Byte>.ExclusiveOr(Byte, Byte)

배타적 또는 두 값을 계산합니다.

IBitwiseOperators<Byte,Byte,Byte>.OnesComplement(Byte)

지정된 값의 보수 표현을 계산합니다.

IComparable.CompareTo(Object)

현재 인스턴스를 동일한 형식의 다른 개체와 비교하고 현재 인스턴스가 다른 개체와 정렬 순서의 동일한 위치에서 선행, 팔로우 또는 발생하는지 여부를 나타내는 정수를 반환합니다.

IComparisonOperators<Byte,Byte,Boolean>.GreaterThan(Byte, Byte)

두 값을 비교하여 더 큰 값을 결정합니다.

IComparisonOperators<Byte,Byte,Boolean>.GreaterThanOrEqual(Byte, Byte)

두 값을 비교하여 크거나 같은 값을 결정합니다.

IComparisonOperators<Byte,Byte,Boolean>.LessThan(Byte, Byte)

두 값을 비교하여 더 적은 값을 결정합니다.

IComparisonOperators<Byte,Byte,Boolean>.LessThanOrEqual(Byte, Byte)

두 값을 비교하여 어느 값이 작거나 같은지 확인합니다.

IConvertible.GetTypeCode()

이 인스턴스에 TypeCode 대한 값을 반환합니다.

IConvertible.ToBoolean(IFormatProvider)

이 멤버에 대한 설명은 을 참조하세요 ToBoolean(IFormatProvider).

IConvertible.ToByte(IFormatProvider)

이 멤버에 대한 설명은 을 참조하세요 ToByte(IFormatProvider).

IConvertible.ToChar(IFormatProvider)

이 멤버에 대한 설명은 을 참조하세요 ToChar(IFormatProvider).

IConvertible.ToDateTime(IFormatProvider)

이 변환은 지원되지 않습니다. 이 메서드를 사용하려고 하면 .InvalidCastException

IConvertible.ToDecimal(IFormatProvider)

이 멤버에 대한 설명은 을 참조하세요 ToDecimal(IFormatProvider).

IConvertible.ToDouble(IFormatProvider)

이 멤버에 대한 설명은 을 참조하세요 ToDouble(IFormatProvider).

IConvertible.ToInt16(IFormatProvider)

이 멤버에 대한 설명은 을 참조하세요 ToInt16(IFormatProvider).

IConvertible.ToInt32(IFormatProvider)

이 멤버에 대한 설명은 을 참조하세요 ToInt32(IFormatProvider).

IConvertible.ToInt64(IFormatProvider)

이 멤버에 대한 설명은 을 참조하세요 ToInt64(IFormatProvider).

IConvertible.ToSByte(IFormatProvider)

이 멤버에 대한 설명은 을 참조하세요 ToSByte(IFormatProvider).

IConvertible.ToSingle(IFormatProvider)

이 멤버에 대한 설명은 을 참조하세요 ToSingle(IFormatProvider).

IConvertible.ToType(Type, IFormatProvider)

이 멤버에 대한 설명은 을 참조하세요 ToType(Type, IFormatProvider).

IConvertible.ToUInt16(IFormatProvider)

이 멤버에 대한 설명은 을 참조하세요 ToUInt16(IFormatProvider).

IConvertible.ToUInt32(IFormatProvider)

이 멤버에 대한 설명은 을 참조하세요 ToUInt32(IFormatProvider).

IConvertible.ToUInt64(IFormatProvider)

이 멤버에 대한 설명은 을 참조하세요 ToUInt64(IFormatProvider).

IDecrementOperators<Byte>.CheckedDecrement(Byte)

값을 줄입니다.

IDecrementOperators<Byte>.Decrement(Byte)

값을 줄입니다.

IDivisionOperators<Byte,Byte,Byte>.Division(Byte, Byte)

한 값을 다른 값으로 나누어 몫을 계산합니다.

IEqualityOperators<Byte,Byte,Boolean>.Equality(Byte, Byte)

두 값을 비교하여 같음을 확인합니다.

IEqualityOperators<Byte,Byte,Boolean>.Inequality(Byte, Byte)

두 값을 비교하여 같지 않음을 확인합니다.

IIncrementOperators<Byte>.CheckedIncrement(Byte)

값을 증분합니다.

IIncrementOperators<Byte>.Increment(Byte)

값을 증분합니다.

IMinMaxValue<Byte>.MaxValue

현재 형식의 최대값을 가져옵니다.

IMinMaxValue<Byte>.MinValue

현재 형식의 최소값을 가져옵니다.

IModulusOperators<Byte,Byte,Byte>.Modulus(Byte, Byte)

두 값을 함께 나누어 모듈러스 또는 나머지를 계산합니다.

IMultiplicativeIdentity<Byte,Byte>.MultiplicativeIdentity

현재 형식의 곱하기 ID를 가져옵니다.

IMultiplyOperators<Byte,Byte,Byte>.CheckedMultiply(Byte, Byte)

두 값을 함께 곱하여 제품을 계산합니다.

IMultiplyOperators<Byte,Byte,Byte>.Multiply(Byte, Byte)

두 값을 함께 곱하여 제품을 계산합니다.

INumber<Byte>.CopySign(Byte, Byte)

값의 기호를 다른 값의 기호에 복사합니다.

INumber<Byte>.MaxNumber(Byte, Byte)

두 값을 더 큰 컴퓨팅과 비교하고 입력 NaN이 있는 경우 다른 값을 반환합니다.

INumber<Byte>.MinNumber(Byte, Byte)

두 값을 더 작은 컴퓨팅과 비교하고 입력 NaN이 있으면 다른 값을 반환합니다.

INumberBase<Byte>.Abs(Byte)

값의 절대값을 계산합니다.

INumberBase<Byte>.IsCanonical(Byte)

값이 정식 표현에 있는지 여부를 확인합니다.

INumberBase<Byte>.IsComplexNumber(Byte)

값이 복소수를 나타내는지 여부를 결정합니다.

INumberBase<Byte>.IsFinite(Byte)

값이 유한한지 여부를 확인합니다.

INumberBase<Byte>.IsImaginaryNumber(Byte)

값이 순수 허수 수를 나타내는지 여부를 확인합니다.

INumberBase<Byte>.IsInfinity(Byte)

값이 무한인지 여부를 확인합니다.

INumberBase<Byte>.IsInteger(Byte)

값이 정수인지 여부를 결정합니다.

INumberBase<Byte>.IsNaN(Byte)

값이 NaN인지 여부를 확인합니다.

INumberBase<Byte>.IsNegative(Byte)

값이 음수인지 여부를 확인합니다.

INumberBase<Byte>.IsNegativeInfinity(Byte)

값이 음수 무한대인지 여부를 확인합니다.

INumberBase<Byte>.IsNormal(Byte)

값이 정상인지 여부를 확인합니다.

INumberBase<Byte>.IsPositive(Byte)

값이 양수인지 여부를 확인합니다.

INumberBase<Byte>.IsPositiveInfinity(Byte)

값이 양의 무한대인지 여부를 확인합니다.

INumberBase<Byte>.IsRealNumber(Byte)

값이 실수인지 여부를 확인합니다.

INumberBase<Byte>.IsSubnormal(Byte)

값이 영수인지 여부를 확인합니다.

INumberBase<Byte>.IsZero(Byte)

값이 0인지 여부를 확인합니다.

INumberBase<Byte>.MaxMagnitude(Byte, Byte)

두 값을 더 큰 컴퓨팅과 비교합니다.

INumberBase<Byte>.MaxMagnitudeNumber(Byte, Byte)

크기가 더 큰 컴퓨팅과 두 값을 비교하고 입력 NaN이 있는 경우 다른 값을 반환합니다.

INumberBase<Byte>.MinMagnitude(Byte, Byte)

두 값을 더 작은 컴퓨팅과 비교합니다.

INumberBase<Byte>.MinMagnitudeNumber(Byte, Byte)

크기가 작은 컴퓨팅과 두 값을 비교하고 입력 NaN이 있으면 다른 값을 반환합니다.

INumberBase<Byte>.MultiplyAddEstimate(Byte, Byte, Byte)

() + left.의 추정치를 * rightaddend 계산합니다.

INumberBase<Byte>.One

형식의 값을 1 가져옵니다.

INumberBase<Byte>.Radix

형식의 radix 또는 base를 가져옵니다.

INumberBase<Byte>.TryConvertFromChecked<TOther>(TOther, Byte)

부호 없는 8비트 정수입니다.

INumberBase<Byte>.TryConvertFromSaturating<TOther>(TOther, Byte)

부호 없는 8비트 정수입니다.

INumberBase<Byte>.TryConvertFromTruncating<TOther>(TOther, Byte)

부호 없는 8비트 정수입니다.

INumberBase<Byte>.TryConvertToChecked<TOther>(Byte, TOther)

현재 형식의 인스턴스를 다른 형식으로 변환하여 현재 형식의 표시 가능한 범위를 벗어나는 값에 대해 오버플로 예외를 throw합니다.

INumberBase<Byte>.TryConvertToSaturating<TOther>(Byte, TOther)

현재 형식의 인스턴스를 다른 형식으로 변환하여 현재 형식의 표현 가능한 범위를 벗어나는 값을 채도합니다.

INumberBase<Byte>.TryConvertToTruncating<TOther>(Byte, TOther)

현재 형식의 인스턴스를 다른 형식으로 변환하여 현재 형식의 표현 가능한 범위를 벗어나는 값을 잘리려고 합니다.

INumberBase<Byte>.Zero

형식의 값을 0 가져옵니다.

IShiftOperators<Byte,Int32,Byte>.LeftShift(Byte, Int32)

지정된 양만큼 남은 값을 이동합니다.

IShiftOperators<Byte,Int32,Byte>.RightShift(Byte, Int32)

값을 지정된 양만큼 오른쪽으로 이동합니다.

IShiftOperators<Byte,Int32,Byte>.UnsignedRightShift(Byte, Int32)

값을 지정된 양만큼 오른쪽으로 이동합니다.

ISubtractionOperators<Byte,Byte,Byte>.CheckedSubtraction(Byte, Byte)

두 값을 빼서 차이를 계산합니다.

ISubtractionOperators<Byte,Byte,Byte>.Subtraction(Byte, Byte)

두 값을 빼서 차이를 계산합니다.

IUnaryNegationOperators<Byte,Byte>.CheckedUnaryNegation(Byte)

값의 확인된 단항 부정을 계산합니다.

IUnaryNegationOperators<Byte,Byte>.UnaryNegation(Byte)

값의 단항 부정을 계산합니다.

IUnaryPlusOperators<Byte,Byte>.UnaryPlus(Byte)

값의 단항 플러스를 계산합니다.

적용 대상

스레드 보안

이 형식의 모든 멤버는 스레드로부터 안전합니다. 인스턴스 상태를 수정하는 것처럼 보이는 멤버는 실제로 새 값으로 초기화된 새 인스턴스를 반환합니다. 다른 형식과 마찬가지로 이 형식의 인스턴스를 포함하는 공유 변수에 대한 읽기 및 쓰기는 스레드 안전을 보장하기 위해 잠금으로 보호되어야 합니다.

추가 정보