Skip to content

Commit 42298b2

Browse files
[jni] Clarify JBuffer.array docs (#1925)
1 parent 4282a79 commit 42298b2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkgs/jni/lib/src/nio/jbuffer.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,15 @@ class JBuffer extends JObject {
246246

247247
/// The array that backs this buffer.
248248
///
249+
/// Note that the first element of the buffer starts at element [arrayOffset]
250+
/// of the backing array.
251+
///
249252
/// Concrete subclasses like [JByteBuffer] provide more strongly-typed return
250253
/// values for this method.
251254
///
255+
/// Invoke the [hasArray] method before invoking this method in order to
256+
/// ensure that this buffer has an accessible backing array.
257+
///
252258
/// Throws:
253259
/// * `ReadOnlyBufferException` - If this buffer is backed by an array but is
254260
/// read-only
@@ -263,6 +269,9 @@ class JBuffer extends JObject {
263269
/// The offset within this buffer's backing array of the first element
264270
/// of the buffer.
265271
///
272+
/// Invoke the [hasArray] method before invoking this method in order to
273+
/// ensure that this buffer has an accessible backing array.
274+
///
266275
/// Throws:
267276
/// * `ReadOnlyBufferException` - If this buffer is backed by an array but is
268277
/// read-only

0 commit comments

Comments
 (0)