Class NetworkReader
Network Reader for most simple types like floats, ints, buffers, structs, etc. Use NetworkReaderPool.GetReader() to avoid allocations.
Inheritance
NetworkReader
Assembly: doc.dll
Syntax
public class NetworkReader : object
Constructors
|
Improve this Doc
View Source
NetworkReader(ArraySegment<Byte>)
Declaration
public NetworkReader(ArraySegment<byte> segment)
Parameters
Type |
Name |
Description |
ArraySegment<Byte> |
segment |
|
|
Improve this Doc
View Source
NetworkReader(Byte[])
Declaration
public NetworkReader(byte[] bytes)
Parameters
Type |
Name |
Description |
Byte[] |
bytes |
|
Fields
|
Improve this Doc
View Source
Position
Next position to read from the buffer
Declaration
Field Value
Properties
|
Improve this Doc
View Source
Length
Total number of bytes to read from buffer
Declaration
public int Length { get; }
Property Value
|
Improve this Doc
View Source
Remaining
Remaining bytes that can be read, for convenience.
Declaration
public int Remaining { get; }
Property Value
Methods
|
Improve this Doc
View Source
Read<T>()
Reads any data type that mirror supports. Uses weaver populated Reader(T).read
Declaration
Returns
Type Parameters
|
Improve this Doc
View Source
ReadByte()
Declaration
Returns
|
Improve this Doc
View Source
ReadBytes(Byte[], Int32)
Read 'count' bytes into the bytes array
Declaration
public byte[] ReadBytes(byte[] bytes, int count)
Parameters
Type |
Name |
Description |
Byte[] |
bytes |
|
Int32 |
count |
|
Returns
|
Improve this Doc
View Source
ReadBytesSegment(Int32)
Read 'count' bytes allocation-free as ArraySegment that points to the internal array.
Declaration
public ArraySegment<byte> ReadBytesSegment(int count)
Parameters
Type |
Name |
Description |
Int32 |
count |
|
Returns
Type |
Description |
ArraySegment<Byte> |
|
|
Improve this Doc
View Source
SetBuffer(ArraySegment<Byte>)
Declaration
public void SetBuffer(ArraySegment<byte> segment)
Parameters
Type |
Name |
Description |
ArraySegment<Byte> |
segment |
|
|
Improve this Doc
View Source
SetBuffer(Byte[])
Declaration
public void SetBuffer(byte[] bytes)
Parameters
Type |
Name |
Description |
Byte[] |
bytes |
|
|
Improve this Doc
View Source
ToString()
Declaration
public override string ToString()
Returns
Extension Methods