Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.mina.common
Interface ByteBufferAllocator

All Known Implementing Classes:
  PooledByteBufferAllocator, SimpleByteBufferAllocator

    public interface ByteBufferAllocator

Allocates `ByteBuffer`s and manages them. Please implement this interface if you need more advanced memory management scheme.

Version:
  $Rev: 555855 $, $Date: 2007-07-13 12:19:00 +0900 (Fri, 13 Jul 2007) $
Author:
  The Apache Directory Project (mina-dev@directory.apache.org)

Method Summary
`ByteBuffer` | `allocate(int capacity, boolean direct)` Returns the buffer which is capable of the specified size.
`void` | `dispose()` Dispose of this allocator.
`ByteBuffer` | `wrap(ByteBuffer nioBuffer)` Wraps the specified NIO `ByteBuffer` into MINA buffer.

Method Detail

### allocate

    ByteBuffer allocate(int capacity,
                        boolean direct)

  Returns the buffer which is capable of the specified size.

  Parameters:
    `capacity` - the capacity of the buffer
    `direct` - `true` to get a direct buffer, `false` to get a heap buffer.

### wrap

    ByteBuffer wrap(ByteBuffer nioBuffer)

  Wraps the specified NIO `ByteBuffer` into MINA buffer.

### dispose

    void dispose()

  Dispose of this allocator.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2008 Apache MINA Project. All Rights Reserved.