io.undertow.server

## Class XnioByteBufferPool

- java.lang.Object
- - io.undertow.server.XnioByteBufferPool

All Implemented Interfaces:
  ByteBufferPool, Closeable, AutoCloseable

    public class XnioByteBufferPool
    extends Object
    implements ByteBufferPool

Author:
  Stuart Douglas

### Constructor Summary

Constructors
Constructor and Description
`XnioByteBufferPool(org.xnio.Pool<ByteBuffer> pool)`

### Method Summary

All Methods Instance Methods Concrete Methods
`PooledByteBuffer` `allocate()`
`void` `close()`
`ByteBufferPool` `getArrayBackedPool()` If this byte buffer pool corresponds to an array backed pool then this will return itself.
`int` `getBufferSize()`
`boolean` `isDirect()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### XnioByteBufferPool

    public XnioByteBufferPool(org.xnio.Pool<ByteBuffer> pool)

### Method Detail

#### allocate

    public PooledByteBuffer allocate()

Specified by:
  `allocate` in interface `ByteBufferPool`

#### getArrayBackedPool

    public ByteBufferPool getArrayBackedPool()

Description copied from interface: `ByteBufferPool`
If this byte buffer pool corresponds to an array backed pool then this will return itself. Otherwise it will return an array backed pool that contains buffers of the same size.

Specified by:
  `getArrayBackedPool` in interface `ByteBufferPool`
Returns:
  An array backed pool of the same size

#### close

    public void close()

Specified by:
  `close` in interface `ByteBufferPool`
Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `AutoCloseable`

#### getBufferSize

    public int getBufferSize()

Specified by:
  `getBufferSize` in interface `ByteBufferPool`

#### isDirect

    public boolean isDirect()

Specified by:
  `isDirect` in interface `ByteBufferPool`