System.BitConverter.GetBytes Method

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

Syntax

public static byte[] GetBytes (int value)

Parameters

value
The number to convert.

Returns

An array of bytes with length 4.

Remarks

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

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0