Spring Framework 5 uses Undertow APIs directly, i.e. not going through the Servlet API.
When reading the request the ByteBufferPool is obtained from the connection
and then the PooledByteBuffer is allocated and used [1].
Also the PooledByteBuffer is closed in ExchangeCompletionListener [2].
So currently the usage is limited only to the request reading.
In order to extend the usage of the ByteBufferPool we need to be able to allocate buffers with a concrete size.
At the moment (what I saw in the sources) the ByteBufferPool is created with a specific buffer size
and the pooled buffers are created with exactly this size.
For comparison see the io.netty.buffer.PooledByteBufAllocator in Netty
which provides a functionality to allocated buffers with a specific size [3], [4], [5].
So is it possible to achieve the same with the Undertow's ByteBufferPool?
If such functionality is not existing do you think it is feasible to add such API?
Thanks,
Violeta