Author: trustin
Date: Mon Nov 12 19:49:11 2007
New Revision: 594418
URL: http://svn.apache.org/viewvc?rev=594418&view=rev
Log:
Updated JavaDoc
Modified:
mina/trunk/core/src/main/java/org/apache/mina/common/IoBuffer.java
Modified: mina/trunk/core/src/main/java/org/apache/mina/common/IoBuffer.java
URL:
http://svn.apache.org/viewvc/mina/trunk/core/src/main/java/org/apache/mina/common/IoBuffer.java?rev=594418&r1=594417&r2=594418&view=diff
==============================================================================
--- mina/trunk/core/src/main/java/org/apache/mina/common/IoBuffer.java
(original)
+++ mina/trunk/core/src/main/java/org/apache/mina/common/IoBuffer.java Mon Nov
12 19:49:11 2007
@@ -86,9 +86,9 @@
* <h2>AutoExpand</h2>
* <p>
* Writing variable-length data using NIO <tt>ByteBuffers</tt> is not really
- * easy, and it is because its size is fixed. MINA [EMAIL PROTECTED] IoBuffer}
- * introduces <tt>autoExpand</tt> property. If <tt>autoExpand</tt> property
- * is true, you never get [EMAIL PROTECTED] BufferOverflowException} or
+ * easy, and it is because its size is fixed. [EMAIL PROTECTED] IoBuffer}
introduces
+ * <tt>autoExpand</tt> property. If <tt>autoExpand</tt> property is true, you
+ * never get [EMAIL PROTECTED] BufferOverflowException} or
* [EMAIL PROTECTED] IndexOutOfBoundsException} (except when index is
negative).
* It automatically expands its capacity and limit value. For example:
* <pre>
@@ -98,25 +98,29 @@
* buf.setAutoExpand( true );
* buf.putString( greeting, utf8encoder );
* </pre>
- * NIO <tt>ByteBuffer</tt> is reallocated by MINA [EMAIL PROTECTED] IoBuffer}
behind
- * 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 underlying [EMAIL PROTECTED] ByteBuffer} is reallocated by [EMAIL
PROTECTED] IoBuffer} behind
+ * the scene if the encoded data is larger than 16 bytes in the example above.
+ * Its capacity will double, and its limit will increase to the last position
* the string is written.
* </p>
*
* <h2>AutoShrink</h2>
* <p>
* You might also want to decrease the capacity of the buffer when most
- * of the allocated memory area is not being used. MINA [EMAIL PROTECTED]
IoBuffer}
- * provides <tt>autoShrink</tt> property to take care of this issue.
- * If <tt>autoShrink</tt> is turned on, [EMAIL PROTECTED] IoBuffer} halves the
capacity
+ * of the allocated memory area is not being used. [EMAIL PROTECTED]
IoBuffer} provides
+ * <tt>autoShrink</tt> property to take care of this issue. If
+ * <tt>autoShrink</tt> is turned on, [EMAIL PROTECTED] IoBuffer} halves the
capacity
* of the buffer when [EMAIL PROTECTED] #compact()} is invoked and only 1/4 or
less of
- * the current capacity is being used. NIO <tt>ByteBuffer</tt> is reallocated
- * by MINA [EMAIL PROTECTED] IoBuffer} behind the scene, and therefore [EMAIL
PROTECTED] #buf()}
- * will return a different [EMAIL PROTECTED] ByteBuffer} instance once
capacity is
- * changed. Please also note [EMAIL PROTECTED] #compact()} will not decrease
the
- * capacity if the new capacity is less than the initial capacity of the
- * buffer.
+ * the current capacity is being used.
+ * <p>
+ * You can also [EMAIL PROTECTED] #shrink()} method manually to shrink the
capacity of
+ * the buffer.
+ * <p>
+ * The underlying [EMAIL PROTECTED] ByteBuffer} is reallocated by [EMAIL
PROTECTED] IoBuffer} behind
+ * the scene, and therefore [EMAIL PROTECTED] #buf()} will return a different
+ * [EMAIL PROTECTED] ByteBuffer} instance once capacity changes. Please also
note
+ * [EMAIL PROTECTED] #compact()} or [EMAIL PROTECTED] #shrink()} will not
decrease the capacity if
+ * the new capacity is less than the [EMAIL PROTECTED] #minimumCapacity()} of
the buffer.
*
* <h2>Derived Buffers</h2>
* <p>
@@ -131,11 +135,11 @@
*
* <h2>Changing Buffer Allocation Policy</h2>
* <p>
- * MINA provides a [EMAIL PROTECTED] IoBufferAllocator} interface to let you
override
- * the default buffer management behavior. There's only one allocator
- * provided out-of-the-box:
+ * [EMAIL PROTECTED] IoBufferAllocator} interface lets you override the
default buffer
+ * management behavior. There are two allocators provided out-of-the-box:
* <ul>
- * <li>[EMAIL PROTECTED] SimpleBufferAllocator}</li>
+ * <li>[EMAIL PROTECTED] SimpleBufferAllocator} (default)</li>
+ * <li>[EMAIL PROTECTED] CachedBufferAllocator}</li>
* </ul>
* You can implement your own allocator and use it by calling
* [EMAIL PROTECTED] #setAllocator(IoBufferAllocator)}.
@@ -143,8 +147,6 @@
*
* @author The Apache MINA Project ([EMAIL PROTECTED])
* @version $Rev$, $Date$
- *
- * @see IoBufferAllocator
*/
public abstract class IoBuffer implements Comparable<IoBuffer> {
private static IoBufferAllocator allocator = new SimpleBufferAllocator();