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

Print this page

        

*** 650,662 **** * * <p> In other words, an invocation of this method of the form * <tt>src.get(dst,&nbsp;off,&nbsp;len)</tt> has exactly the same effect as * the loop * ! * <pre> * for (int i = off; i < off + len; i++) ! * 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 --- 650,663 ---- * * <p> In other words, an invocation of this method of the form * <tt>src.get(dst,&nbsp;off,&nbsp;len)</tt> has exactly the same effect as * the loop * ! * <pre>{@code * for (int i = off; i < off + len; i++) ! * 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,798 **** * * <p> In other words, an invocation of this method of the form * <tt>dst.put(src,&nbsp;off,&nbsp;len)</tt> has exactly the same effect as * the loop * ! * <pre> * for (int i = off; i < off + len; i++) ! * 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 --- 787,800 ---- * * <p> In other words, an invocation of this method of the form * <tt>dst.put(src,&nbsp;off,&nbsp;len)</tt> has exactly the same effect as * the loop * ! * <pre>{@code * for (int i = off; i < off + len; i++) ! * 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,884 **** * * <p> In other words, an invocation of this method of the form * <tt>dst.put(src,&nbsp;start,&nbsp;end)</tt> has exactly the same effect * as the loop * ! * <pre> * for (int i = start; i < end; i++) ! * 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 --- 874,887 ---- * * <p> In other words, an invocation of this method of the form * <tt>dst.put(src,&nbsp;start,&nbsp;end)</tt> has exactly the same effect * as the loop * ! * <pre>{@code * for (int i = start; i < end; i++) ! * 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,1051 **** * * <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> * 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 --- 1039,1055 ---- * * <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>{@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