Class ByteBufferPool
- java.lang.Object
-
- jdk.incubator.http.internal.common.ByteBufferPool
-
public class ByteBufferPool extends java.lang.Object
The class provides reuse of ByteBuffers. It is supposed that all requested buffers have the same size for a long period of time. That is why there is no any logic splitting buffers into different buckets (by size). It's unnecessary. At the same moment it is allowed to change requested buffers size (all smaller buffers will be discarded). It may be needed for example, if after rehandshaking netPacketBufferSize was changed.
-
-
Constructor Summary
Constructors Constructor Description ByteBufferPool()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteBufferReference
get(int size)
void
release(java.nio.ByteBuffer buffer)
-
-
-
Method Detail
-
get
public ByteBufferReference get(int size)
-
release
public void release(java.nio.ByteBuffer buffer)
-
-