You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by tr...@apache.org on 2006/03/22 10:16:16 UTC
svn commit: r387804 -
/directory/trunks/mina/core/src/main/java/org/apache/mina/common/ByteBuffer.java
Author: trustin
Date: Wed Mar 22 01:16:14 2006
New Revision: 387804
URL: http://svn.apache.org/viewcvs?rev=387804&view=rev
Log:
Added documentation for derived buffers
Modified:
directory/trunks/mina/core/src/main/java/org/apache/mina/common/ByteBuffer.java
Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/common/ByteBuffer.java
URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/main/java/org/apache/mina/common/ByteBuffer.java?rev=387804&r1=387803&r2=387804&view=diff
==============================================================================
--- directory/trunks/mina/core/src/main/java/org/apache/mina/common/ByteBuffer.java (original)
+++ directory/trunks/mina/core/src/main/java/org/apache/mina/common/ByteBuffer.java Wed Mar 22 01:16:14 2006
@@ -57,6 +57,7 @@
* <li>It is difficult to write variable-length data due to its fixed
* capacity</li>
* </ul>
+ * </p>
*
* <h2>Allocation</h2>
* <p>
@@ -72,6 +73,7 @@
* <pre>
* ByteBuffer buf = ByteBuffer.allocate(1024);
* </pre>
+ * </p>
*
* <h2>Acquire/Release</h2>
* <p>
@@ -91,6 +93,7 @@
* <li>You allocated a buffer, but didn't pass the buffer to any of two methods above.</li>
* <li>You called {@link #acquire()} to prevent the buffer from being released.</li>
* </ul>
+ * </p>
*
* <h2>Wrapping existing NIO buffers and arrays</h2>
* <p>
@@ -119,6 +122,17 @@
* the scene if the encoded data is larger than 16 bytes. Its capacity will
* increase by two times, and its limit will increase to the last position
* the string is written.
+ * </p>
+ *
+ * <h2>Derived Buffers</h2>
+ * <p>
+ * Derived buffers are the buffers which were created by
+ * {@link #duplicate()}, {@link #slice()}, or {@link #asReadOnlyBuffer()}.
+ * They are useful especially when you broadcast the same messages to
+ * multiple {@link IoSession}s. Please note that the derived buffers are
+ * neither pooled nor auto-expandable. Trying to expand a derived buffer will
+ * raise {@link IllegalStateException}.
+ * </p>
*
* <h2>Changing Buffer Allocation and Management Policy</h2>
* <p>