BitConverter.GetBytes Method (Int64)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Returns the specified 64-bit signed integer value as an array of bytes.

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

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

Parameters

value
Type: System.Int64

The number to convert.

Return Value

Type: System.Byte[]

An array of bytes with length 8.

The order of bytes in the array returned by the GetBytes method depends on whether the computer architecture is little-endian or big-endian.

The following example calls the GetBytes method to convert each element in an Int64 array to aByte arrays.

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
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: