Skip to content

Commit 46cca1a

Browse files
author
Brian Burkhalter
committed
4842457: (bf spec) Clarify meaning of "(optional operation)"
Reviewed-by: alanb
1 parent 6fa25cc commit 46cca1a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/java.base/share/classes/java/nio/X-Buffer.java.template

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,15 @@ import jdk.internal.util.ArraysSupport;
258258
* cb.put("text/").put(subtype).put("; charset=").put(enc);</pre></blockquote>
259259
*
260260
#end[char]
261+
* <h2> Optional operations </h2>
262+
* Methods specified as
263+
* <i>{@linkplain Buffer##read-only-buffers-heading optional
264+
* operations}</i> throw a {@linkplain ReadOnlyBufferException} when invoked
265+
* on a {@linkplain java.nio.Buffer#isReadOnly read-only} $Type$Buffer. The
266+
* methods {@linkplain #array array} and {@linkplain #arrayOffset arrayOffset}
267+
* throw an {@linkplain UnsupportedOperationException} if the $Type$Buffer is
268+
* not backed by an {@linkplain Buffer#hasArray accessible $type$ array}
269+
* (irrespective of whether the $Type$Buffer is read-only).
261270
*
262271
*
263272
* @author Mark Reinhold

0 commit comments

Comments
 (0)