BitConverter.GetBytes Method (Boolean)


Returns the specified Boolean value as a byte array.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

static member GetBytes : 
        value:bool -> byte[]


Type: System.Boolean

A Boolean value.

Return Value

Type: System.Byte[]

A byte array with length 1.

You can convert a byte array back to a Boolean value by calling the ToBoolean method.

The following example converts the bit patterns of Boolean values to Byte arrays with the GetBytes method.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top