org.apache.http.nio.util

## Class HeapByteBufferAllocator

- java.lang.Object
- - org.apache.http.nio.util.HeapByteBufferAllocator

All Implemented Interfaces:
  ByteBufferAllocator

    @Immutable
    public class HeapByteBufferAllocator
    extends Object
    implements ByteBufferAllocator

Allocates `ByteBuffer` instances using `ByteBuffer.allocate(int)`.

Since:
  4.0

### Field Summary

Fields
`static HeapByteBufferAllocator` `INSTANCE`

### Constructor Summary

Constructors
Constructor and Description
`HeapByteBufferAllocator()`

### Method Summary

Methods
`ByteBuffer` `allocate(int size)` Allocates `ByteBuffer` of the given size.

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

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

### Field Detail

#### INSTANCE

    public static final HeapByteBufferAllocator INSTANCE

### Constructor Detail

#### HeapByteBufferAllocator

    public HeapByteBufferAllocator()

### Method Detail

#### allocate

    public ByteBuffer allocate(int size)

Description copied from interface: `ByteBufferAllocator`
Allocates `ByteBuffer` of the given size.

Specified by:
  `allocate` in interface `ByteBufferAllocator`
Parameters:
  `size` - the size of the buffer.
Returns:
  byte buffer.