com.sun.grizzly.memory
Class DefaultMemoryManager.TrimAwareWrapper

java.lang.Object
  extended by com.sun.grizzly.memory.ByteBufferWrapper
      extended by com.sun.grizzly.memory.DefaultMemoryManager.TrimAwareWrapper
All Implemented Interfaces:
Buffer<ByteBuffer>, Comparable<Buffer<ByteBuffer>>
Enclosing class:
DefaultMemoryManager

public class DefaultMemoryManager.TrimAwareWrapper
extends ByteBufferWrapper

ByteBufferWrapper implementation, which supports triming. In other words it's possible to return unused Buffer space to pool.


Field Summary
 
Fields inherited from class com.sun.grizzly.memory.ByteBufferWrapper
DEBUG_MODE, memoryManager, visible
 
Constructor Summary
DefaultMemoryManager.TrimAwareWrapper(ByteBufferManager memoryManager, ByteBuffer underlyingByteBuffer)
           
 
Method Summary
 void trim()
          Trim the buffer by reducing capacity to position, if possible.
 
Methods inherited from class com.sun.grizzly.memory.ByteBufferWrapper
asReadOnlyBuffer, capacity, clear, compact, compareTo, contentAsString, dispose, duplicate, equals, flip, get, get, get, get, getChar, getChar, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getShort, getShort, hashCode, hasRemaining, isReadOnly, limit, limit, mark, order, order, position, position, prepend, put, put, put, put, put, putChar, putChar, putDouble, putDouble, putFloat, putFloat, putInt, putInt, putLong, putLong, putShort, putShort, remaining, reset, rewind, slice, toString, underlying
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultMemoryManager.TrimAwareWrapper

public DefaultMemoryManager.TrimAwareWrapper(ByteBufferManager memoryManager,
                                             ByteBuffer underlyingByteBuffer)
Method Detail

trim

public void trim()
Description copied from interface: Buffer
Trim the buffer by reducing capacity to position, if possible. May return without changing capacity. Also resets the position to 0, like reset().

Specified by:
trim in interface Buffer<ByteBuffer>
Overrides:
trim in class ByteBufferWrapper


Copyright © 2009 SUN Microsystems. All Rights Reserved.