Compartir a través de


ByteBuffer.Wrap Method

Definition

Overloads

Wrap(Byte[], Int32, Int32)

Wraps a byte array into a buffer.

Wrap(Byte[])

Wraps a byte array into a buffer.

Wrap(Byte[], Int32, Int32)

Wraps a byte array into a buffer.

[Android.Runtime.Register("wrap", "([BII)Ljava/nio/ByteBuffer;", "")]
public static Java.Nio.ByteBuffer Wrap (byte[] array, int offset, int length);
[<Android.Runtime.Register("wrap", "([BII)Ljava/nio/ByteBuffer;", "")>]
static member Wrap : byte[] * int * int -> Java.Nio.ByteBuffer

Parameters

array
Byte[]

The array that will back the new buffer

offset
Int32

The offset of the subarray to be used; must be non-negative and no larger than array.length. The new buffer's position will be set to this value.

length
Int32

The length of the subarray to be used; must be non-negative and no larger than array.length - offset. The new buffer's limit will be set to offset + length.

Returns

The new byte buffer

Attributes

Exceptions

if either start or byteCount is invalid.

Remarks

Wraps a byte array into a buffer.

The new buffer will be backed by the given byte array; that is, modifications to the buffer will cause the array to be modified and vice versa. The new buffer's capacity will be array.length, its position will be offset, its limit will be offset + length, and its mark will be undefined. Its #array backing array will be the given array, and its #arrayOffset array offset will be zero.

Java documentation for java.nio.ByteBuffer.wrap(byte[], int, 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

Wrap(Byte[])

Wraps a byte array into a buffer.

[Android.Runtime.Register("wrap", "([B)Ljava/nio/ByteBuffer;", "")]
public static Java.Nio.ByteBuffer Wrap (byte[] array);
[<Android.Runtime.Register("wrap", "([B)Ljava/nio/ByteBuffer;", "")>]
static member Wrap : byte[] -> Java.Nio.ByteBuffer

Parameters

array
Byte[]

The array that will back this buffer

Returns

The new byte buffer

Attributes

Remarks

Wraps a byte array into a buffer.

The new buffer will be backed by the given byte array; that is, modifications to the buffer will cause the array to be modified and vice versa. The new buffer's capacity and limit will be array.length, its position will be zero, and its mark will be undefined. Its #array backing array will be the given array, and its #arrayOffset array offset> will be zero.

Java documentation for java.nio.ByteBuffer.wrap(byte[]).

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