src/share/classes/java/nio/X-Buffer.java.template
Print this page
@@ -650,13 +650,14 @@
*
* <p> In other words, an invocation of this method of the form
* <tt>src.get(dst, off, len)</tt> has exactly the same effect as
* the loop
*
- * <pre>
+ * <pre>{@code
* for (int i = off; i < off + len; i++)
- * dst[i] = src.get(); </pre>
+ * dst[i] = src.get():
+ * }</pre>
*
* except that it first checks that there are sufficient $type$s in
* this buffer and it is potentially much more efficient. </p>
*
* @param dst
@@ -786,13 +787,14 @@
*
* <p> In other words, an invocation of this method of the form
* <tt>dst.put(src, off, len)</tt> has exactly the same effect as
* the loop
*
- * <pre>
+ * <pre>{@code
* for (int i = off; i < off + len; i++)
- * dst.put(a[i]); </pre>
+ * dst.put(a[i]);
+ * }</pre>
*
* except that it first checks that there is sufficient space in this
* buffer and it is potentially much more efficient. </p>
*
* @param src
@@ -872,13 +874,14 @@
*
* <p> In other words, an invocation of this method of the form
* <tt>dst.put(src, start, end)</tt> has exactly the same effect
* as the loop
*
- * <pre>
+ * <pre>{@code
* for (int i = start; i < end; i++)
- * dst.put(src.charAt(i)); </pre>
+ * dst.put(src.charAt(i));
+ * }</pre>
*
* except that it first checks that there is sufficient space in this
* buffer and it is potentially much more efficient. </p>
*
* @param src
@@ -1036,16 +1039,17 @@
*
* <p> Invoke this method after writing data from a buffer in case the
* write was incomplete. The following loop, for example, copies bytes
* from one channel to another via the buffer <tt>buf</tt>:
*
- * <blockquote><pre>
+ * <blockquote><pre>{@code
* buf.clear(); // Prepare buffer for use
* while (in.read(buf) >= 0 || buf.position != 0) {
* buf.flip();
* out.write(buf);
* buf.compact(); // In case of partial write
+ * }
* }</pre></blockquote>
*
#end[byte]
*
* @return This buffer