ByteLength Method
Collapse the table of content
Expand the table of content

Buffer.ByteLength Method (Array)

 

Returns the number of bytes in the specified array.

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

static member ByteLength : 
        array:Array -> int

Parameters

array
Type: System.Array

An array.

Return Value

Type: System.Int32

The number of bytes in the array.

Exception Condition
ArgumentNullException

array is null.

ArgumentException

array is not a primitive.

OverflowException

array is larger than 2 gigabytes (GB).

The following code example illustrates the use of the ByteLength method to return the number of bytes in an array.

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

Universal Windows Platform
Available since 4.5
.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:
© 2016 Microsoft