Author: mturk Date: Tue Apr 14 18:11:05 2009 New Revision: 764909 URL: http://svn.apache.org/viewvc?rev=764909&view=rev Log: Few more explanations about direct ByteBuffers
Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/DirectByteBuffer.java Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/DirectByteBuffer.java URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/DirectByteBuffer.java?rev=764909&r1=764908&r2=764909&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/DirectByteBuffer.java (original) +++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/DirectByteBuffer.java Tue Apr 14 18:11:05 2009 @@ -19,12 +19,12 @@ import java.nio.ByteBuffer; /** DirectByteBuffer - * <br/> - * <b>Warning</b> Using this class impropery may crash the running JVM. + * Support for managing direct ByteBuffers. + * <br/><br /> + * <b>Warning:</b><br />Using this class impropery may crash the running JVM. * Any method call after free method was called might write or read from * the memory location that has been already allocated for * something else. - * <br /> * Using this class methods on ByteBuffers that were not created by * DirectByteBuffer.allocate methods will almost certainly crash the * running JVM. @@ -81,8 +81,14 @@ /** * Allocate a new ByteBuffer from already allocated memory. - * <br />Allocated memory must be provided from call to the - * Stdlib.alloc or Stdlib.calloc methods. + * <br /><b>Warning:</b><br /> + * Allocated memory must be provided from call to the + * <code>address</code> method or by some other valid method that returns + * the valid memory address. + * Providing invalid value to this call will almost certainly crash the + * running JVM because it represents the real memory address location and + * any operation on <code>ByteBuffer</code> will use it for internal storage + * location. * @param mem The memory to use * @param offset Offset from the memory to use * @param size The amount of memory to use @@ -117,9 +123,10 @@ /** * Deallocates or frees a memory block used by ByteBuffer - * <br /><b>Warning</b> Call this method only on ByteBuffers - * that were created by DirectByteBuffer.allocate methods. - * @param buf Previously allocated ByteBuffer to be freed. + * <br /> + * <b>Warning:</b><br />Call this method only on ByteBuffers + * that were created by <code>DirectByteBuffer.allocate</code> methods. + * @param buf Previously allocated ByteBuffer to be deallocated. * * @throws NullPointerException if <code>buf</code> is null */