allocator static method
Creates a new ByteBufAllocator with the default ByteBufAllocator.capacity of kDefaultByteBufSize or if specified initialCapacity
and
the default ByteBufAllocator.maxCapacity of kDefaultMaxByteBufSize or if specified maxCapacity
.
Implementation
static ByteBufAllocator allocator({int? initialCapacity, int? maxCapacity}) {
var backingBuffer = ByteBuf.createHeap(
initialCapacity: initialCapacity, maxCapacity: maxCapacity);
return InstantRestructuringAllocator(backingBuffer);
}