Class ByteBufferPool
- java.lang.Object
-
- org.jitsi.impl.neomedia.jmfext.media.protocol.ByteBufferPool
-
public class ByteBufferPool extends Object
Represents a pool of ByteBuffers which reduces the allocations and deallocations of ByteBuffers in the Java heap and of native memory in the native heap.- Author:
- Lyubomir Marinov
-
-
Constructor Summary
Constructors Constructor Description ByteBufferPool()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddrain()Drains this ByteBufferPool i.e.ByteBuffergetBuffer(int capacity)Gets a ByteBuffer out of this pool of ByteBuffers which is capable to receiving at least capacity number of bytes.
-
-
-
Method Detail
-
drain
public void drain()
Drains this ByteBufferPool i.e. frees the ByteBuffers that it contains.
-
getBuffer
public ByteBuffer getBuffer(int capacity)
Gets a ByteBuffer out of this pool of ByteBuffers which is capable to receiving at least capacity number of bytes.- Parameters:
capacity- the minimal number of bytes that the returned ByteBuffer is to be capable of receiving- Returns:
- a ByteBuffer which is ready for writing captured media data into and which is capable of receiving at least capacity number of bytes
-
-