Package com.google.protobuf
Class BufferAllocator
java.lang.Object
com.google.protobuf.BufferAllocator
An object responsible for allocation of buffers. This is an extension point to enable buffer
pooling within an application.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract AllocatedBuffer
allocateDirectBuffer
(int capacity) Allocates a direct (i.e.abstract AllocatedBuffer
allocateHeapBuffer
(int capacity) Allocates a buffer with the given capacity that is backed by an array on the heap.static BufferAllocator
unpooled()
Returns an unpooled buffer allocator, which will create a new buffer for each request.
-
Field Details
-
UNPOOLED
-
-
Constructor Details
-
BufferAllocator
BufferAllocator()
-
-
Method Details
-
unpooled
Returns an unpooled buffer allocator, which will create a new buffer for each request. -
allocateHeapBuffer
Allocates a buffer with the given capacity that is backed by an array on the heap. -
allocateDirectBuffer
Allocates a direct (i.e. non-heap) buffer with the given capacity.
-