ByteBuffer.AllocateDirect(Int32) Method

Definition

Allocates a new direct byte buffer.

[Android.Runtime.Register("allocateDirect", "(I)Ljava/nio/ByteBuffer;", "")]
public static Java.Nio.ByteBuffer AllocateDirect (int capacity);
[<Android.Runtime.Register("allocateDirect", "(I)Ljava/nio/ByteBuffer;", "")>]
static member AllocateDirect : int -> Java.Nio.ByteBuffer

Parameters

capacity
Int32

The new buffer's capacity, in bytes

Returns

The new byte buffer

Attributes

Exceptions

if capacity .

Remarks

Allocates a new direct byte buffer.

The new buffer's position will be zero, its limit will be its capacity, its mark will be undefined, and each of its elements will be initialized to zero. Whether or not it has a #hasArray backing array is unspecified.

Java documentation for java.nio.ByteBuffer.allocateDirect(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to