Class WriterPool
Collection of PooledWriter. Stores and gets PooledWriter.
Inheritance
System.Object
WriterPool
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 WriterPool
Methods
Retrieve()
Declaration
public static PooledWriter Retrieve()
Returns
Type | Description |
---|---|
PooledWriter |
Retrieve(NetworkManager)
Gets a writer from the pool.
Declaration
public static PooledWriter Retrieve(NetworkManager networkManager)
Parameters
Type | Name | Description |
---|---|---|
NetworkManager | networkManager |
Returns
Type | Description |
---|---|
PooledWriter |
Retrieve(NetworkManager, Int32)
Gets the next writer in the pool of minimum length.
Declaration
public static PooledWriter Retrieve(NetworkManager networkManager, int length)
Parameters
Type | Name | Description |
---|---|---|
NetworkManager | networkManager | |
System.Int32 | length | Minimum length the writer buffer must be. |
Returns
Type | Description |
---|---|
PooledWriter |
Retrieve(Int32)
Gets the next writer in the pool of minimum length.
Declaration
public static PooledWriter Retrieve(int length)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | length | Minimum length the writer buffer must be. |
Returns
Type | Description |
---|---|
PooledWriter |
Store(PooledWriter)
Returns a writer to the pool.
Declaration
public static void Store(PooledWriter writer)
Parameters
Type | Name | Description |
---|---|---|
PooledWriter | writer |
StoreAndDefault(ref PooledWriter)
Puts writer back into pool if not null, and nullifies source reference.
Declaration
public static void StoreAndDefault(ref PooledWriter writer)
Parameters
Type | Name | Description |
---|---|---|
PooledWriter | writer |
StoreLength(PooledWriter)
Returns a writer to the appropriate length pool. Writers must be a minimum of 1000 bytes in length to be sorted by length. Writers which do not meet the minimum will be resized to 1000 bytes.
Declaration
public static void StoreLength(PooledWriter writer)
Parameters
Type | Name | Description |
---|---|---|
PooledWriter | writer |