This buffer pool is instance thread safe Use GetBuffer to get a MemoryStream (with a publically accessible buffer) Calling Close on this MemoryStream will clear its internal buffer and return the buffer to the pool for reuse MemoryStreams can grow larger than the DEFAULT_BUFFER_SIZE (or whatever you passed in) and the underlying buffers will be returned to the pool at their larger sizes.
More...
|
| BufferPool () |
|
| BufferPool (int bufferSize) |
|
MemoryStream | GetBuffer () |
| Gets a MemoryStream built from a buffer plucked from a thread safe pool The pool grows automatically. Closing the memory stream clears the buffer and returns it to the pool.
|
|
This buffer pool is instance thread safe Use GetBuffer to get a MemoryStream (with a publically accessible buffer) Calling Close on this MemoryStream will clear its internal buffer and return the buffer to the pool for reuse MemoryStreams can grow larger than the DEFAULT_BUFFER_SIZE (or whatever you passed in) and the underlying buffers will be returned to the pool at their larger sizes.
◆ BufferPool() [1/2]
Nakama.Ninja.WebSockets.BufferPool.BufferPool |
( |
| ) |
|
|
inline |
◆ BufferPool() [2/2]
Nakama.Ninja.WebSockets.BufferPool.BufferPool |
( |
int | bufferSize | ) |
|
|
inline |
◆ GetBuffer()
MemoryStream Nakama.Ninja.WebSockets.BufferPool.GetBuffer |
( |
| ) |
|
|
inline |
Gets a MemoryStream built from a buffer plucked from a thread safe pool The pool grows automatically. Closing the memory stream clears the buffer and returns it to the pool.
Implements Nakama.Ninja.WebSockets.IBufferPool.
◆ ReturnBuffer()
void Nakama.Ninja.WebSockets.BufferPool.ReturnBuffer |
( |
byte[] | buffer | ) |
|
|
inlineprotected |
The documentation for this class was generated from the following file: