Photon .NET Client API 4.1.4.8

Public Member Functions | Public Attributes | List of all members
ExitGames.Client.Photon.ByteArraySlice Class Reference

A slice of memory that should be pooled and reused. Wraps a byte-array. More...

Inheritance diagram for ExitGames.Client.Photon.ByteArraySlice:

Public Member Functions

 ByteArraySlice (byte[] buffer, int offset=0, int count=0)
 Create a new ByteArraySlice. The buffer supplied will be used. Usage is similar to ArraySegment. More...
 
 ByteArraySlice ()
 Creates a ByteArraySlice, which is not pooled. It has no Buffer. More...
 
void Dispose ()
 
bool Release ()
 If this item was fetched from a ByteArraySlicePool, this will return it. More...
 
void Reset ()
 Resets Count and Offset to 0 each. More...
 

Public Attributes

byte[] Buffer
 The buffer for the slice. More...
 
int Offset
 The position where the content starts in Buffer. More...
 
int Count
 The length of the data in the Buffer. More...
 

Detailed Description

A slice of memory that should be pooled and reused. Wraps a byte-array.

This is a serializable datatype for the .Net clients. It will serialize and transfer as byte[]. If PhotonPeer.UseByteArraySlicePoolForEvents is enabled, byte-arrays in (incoming) events will be deserialized as ByteArraySlice.

Adjust your OnEvent code accordingly.

Constructor & Destructor Documentation

◆ ByteArraySlice() [1/2]

ExitGames.Client.Photon.ByteArraySlice.ByteArraySlice ( byte[]  buffer,
int  offset = 0,
int  count = 0 
)
inline

Create a new ByteArraySlice. The buffer supplied will be used. Usage is similar to ArraySegment.

Not part of pooling.

◆ ByteArraySlice() [2/2]

ExitGames.Client.Photon.ByteArraySlice.ByteArraySlice ( )
inline

Creates a ByteArraySlice, which is not pooled. It has no Buffer.

Not part of pooling.

Member Function Documentation

◆ Dispose()

void ExitGames.Client.Photon.ByteArraySlice.Dispose ( )
inline

◆ Release()

bool ExitGames.Client.Photon.ByteArraySlice.Release ( )
inline

If this item was fetched from a ByteArraySlicePool, this will return it.

Returns
True if this was a pooled item and it successfully was returned. If it does not belong to a pool nothing will happen, and false will be returned.

◆ Reset()

void ExitGames.Client.Photon.ByteArraySlice.Reset ( )
inline

Resets Count and Offset to 0 each.

Member Data Documentation

◆ Buffer

byte [] ExitGames.Client.Photon.ByteArraySlice.Buffer

The buffer for the slice.

◆ Count

int ExitGames.Client.Photon.ByteArraySlice.Count

The length of the data in the Buffer.

◆ Offset

int ExitGames.Client.Photon.ByteArraySlice.Offset

The position where the content starts in Buffer.


The documentation for this class was generated from the following file: