Package org.apache.http.nio.util
Class DirectByteBufferAllocator
- java.lang.Object
-
- org.apache.http.nio.util.DirectByteBufferAllocator
-
- All Implemented Interfaces:
ByteBufferAllocator
@Contract(threading=IMMUTABLE) public class DirectByteBufferAllocator extends java.lang.Object implements ByteBufferAllocator
AllocatesByteBuffer
instances usingByteBuffer.allocateDirect(int)
.- Since:
- 4.0
-
-
Field Summary
Fields Modifier and Type Field Description static DirectByteBufferAllocator
INSTANCE
-
Constructor Summary
Constructors Constructor Description DirectByteBufferAllocator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.ByteBuffer
allocate(int size)
AllocatesByteBuffer
of the given size.
-
-
-
Field Detail
-
INSTANCE
public static final DirectByteBufferAllocator INSTANCE
-
-
Method Detail
-
allocate
public java.nio.ByteBuffer allocate(int size)
Description copied from interface:ByteBufferAllocator
AllocatesByteBuffer
of the given size.- Specified by:
allocate
in interfaceByteBufferAllocator
- Parameters:
size
- the size of the buffer.- Returns:
- byte buffer.
-
-