3using System.Runtime.CompilerServices;
21 [Obsolete(
"GetReader() was renamed to Get()")]
25 [MethodImpl(MethodImplOptions.AggressiveInlining)]
30 reader.SetBuffer(bytes);
35 [Obsolete(
"GetReader() was renamed to Get()")]
39 [MethodImpl(MethodImplOptions.AggressiveInlining)]
44 reader.SetBuffer(segment);
49 [Obsolete(
"Recycle() was renamed to Return()")]
53 [MethodImpl(MethodImplOptions.AggressiveInlining)]
Pool of NetworkReaders to avoid allocations.
static NetworkReaderPooled Get(byte[] bytes)
Get the next reader in the pool. If pool is empty, creates a new Reader
static void Return(NetworkReaderPooled reader)
Returns a reader to the pool.
static NetworkReaderPooled Get(ArraySegment< byte > segment)
Get the next reader in the pool. If pool is empty, creates a new Reader
Pooled NetworkReader, automatically returned to pool when using 'using'