Share via


Buffer.ArrayOffset Method

Definition

Returns the offset within this buffer's backing array of the first element of the buffer  (optional operation).

[Android.Runtime.Register("arrayOffset", "()I", "GetArrayOffsetHandler")]
public abstract int ArrayOffset ();
[<Android.Runtime.Register("arrayOffset", "()I", "GetArrayOffsetHandler")>]
abstract member ArrayOffset : unit -> int

Returns

The offset within this buffer's array of the first element of the buffer

Attributes

Exceptions

if the buffer is read-only UnsupportedOperationException if the buffer does not expose an array

Remarks

Returns the offset within this buffer's backing array of the first element of the buffer&nbsp;&nbsp;(optional operation).

If this buffer is backed by an array then buffer position p corresponds to array index p&nbsp;+&nbsp;arrayOffset().

Invoke the #hasArray hasArray method before invoking this method in order to ensure that this buffer has an accessible backing array.

Added in 1.6.

Java documentation for java.nio.Buffer.arrayOffset().

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