Class ReaderPool
Collection of PooledReader. Stores and gets PooledReader.
Inheritance
System.Object
ReaderPool
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: FishNet.Serializing
Assembly: FishNet.Runtime.dll
Syntax
public static class ReaderPool
Methods
Retrieve(ArraySegment<Byte>, NetworkManager, Reader.DataSource)
Get the next reader in the pool or creates a new one if none are available.
Declaration
public static PooledReader Retrieve(ArraySegment<byte> segment, NetworkManager networkManager, Reader.DataSource source = Reader.DataSource.Unset)
Parameters
Type | Name | Description |
---|---|---|
System.ArraySegment<System.Byte> | segment | |
NetworkManager | networkManager | |
Reader.DataSource | source |
Returns
Type | Description |
---|---|
PooledReader |
Retrieve(Byte[], NetworkManager, Reader.DataSource)
Get the next reader in the pool
If pool is empty, creates a new Reader
Declaration
public static PooledReader Retrieve(byte[] bytes, NetworkManager networkManager, Reader.DataSource source = Reader.DataSource.Unset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | bytes | |
NetworkManager | networkManager | |
Reader.DataSource | source |
Returns
Type | Description |
---|---|
PooledReader |
Store(PooledReader)
Puts reader back into pool
Declaration
public static void Store(PooledReader reader)
Parameters
Type | Name | Description |
---|---|---|
PooledReader | reader |
StoreAndDefault(ref PooledReader)
Puts reader back into pool if not null, and nullifies source reference.
Declaration
public static void StoreAndDefault(ref PooledReader reader)
Parameters
Type | Name | Description |
---|---|---|
PooledReader | reader |