Mirror Networking
|
Network Reader for most simple types like floats, ints, buffers, structs, etc. Use NetworkReaderPool.GetReader() to avoid allocations. More...
Public Member Functions | |
NetworkReader (byte[] bytes) | |
NetworkReader (ArraySegment< byte > segment) | |
void | SetBuffer (byte[] bytes) |
void | SetBuffer (ArraySegment< byte > segment) |
byte | ReadByte () |
byte[] | ReadBytes (byte[] bytes, int count) |
Read 'count' bytes into the bytes array More... | |
ArraySegment< byte > | ReadBytesSegment (int count) |
Read 'count' bytes allocation-free as ArraySegment that points to the internal array. More... | |
override string | ToString () |
T | Read< T > () |
Reads any data type that mirror supports. Uses weaver populated Reader(T).read More... | |
Public Attributes | |
int | Position |
Next position to read from the buffer More... | |
Properties | |
int | Length [get] |
Total number of bytes to read from buffer More... | |
int | Remaining [get] |
Remaining bytes that can be read, for convenience. More... | |
Network Reader for most simple types like floats, ints, buffers, structs, etc. Use NetworkReaderPool.GetReader() to avoid allocations.
Definition at line 13 of file NetworkReader.cs.
Mirror.NetworkReader.NetworkReader | ( | byte[] | bytes | ) |
Definition at line 39 of file NetworkReader.cs.
Mirror.NetworkReader.NetworkReader | ( | ArraySegment< byte > | segment | ) |
Definition at line 44 of file NetworkReader.cs.
T Mirror.NetworkReader.Read< T > | ( | ) |
Reads any data type that mirror supports. Uses weaver populated Reader(T).read
Definition at line 200 of file NetworkReader.cs.
byte[] Mirror.NetworkReader.ReadBytes | ( | byte[] | bytes, |
int | count | ||
) |
Read 'count' bytes into the bytes array
Definition at line 161 of file NetworkReader.cs.
ArraySegment< byte > Mirror.NetworkReader.ReadBytesSegment | ( | int | count | ) |
Read 'count' bytes allocation-free as ArraySegment that points to the internal array.
Definition at line 180 of file NetworkReader.cs.
void Mirror.NetworkReader.SetBuffer | ( | ArraySegment< byte > | segment | ) |
Definition at line 59 of file NetworkReader.cs.
void Mirror.NetworkReader.SetBuffer | ( | byte[] | bytes | ) |
Definition at line 52 of file NetworkReader.cs.
int Mirror.NetworkReader.Position |
Next position to read from the buffer
Definition at line 23 of file NetworkReader.cs.
|
get |
Total number of bytes to read from buffer
Definition at line 26 of file NetworkReader.cs.
|
get |
Remaining bytes that can be read, for convenience.
Definition at line 33 of file NetworkReader.cs.