Serialization
NetworkReader
Counterpart of NetworkWriter.
generated from the sources
Class in namespace
Nebula · Packages/com.1by3.nebula/Runtime/Serialization/NetworkReader.cspublic sealed class NetworkReaderCounterpart of NetworkWriter. Throws on under-read so malformed packets fail loudly.
Constructors
NetworkReader
public NetworkReader();
public NetworkReader(ArraySegment<byte> segment);
public NetworkReader(byte[] bytes);Properties
Remaining
public int Remaining { get; }Position
public int Position { get; }Methods
Set
public void Set(ArraySegment<byte> segment);ReadSegment
public ArraySegment<byte> ReadSegment(int length);Take the next length bytes as a segment (no copy) and advance past them.
Skip
public void Skip(int bytes);Advance past bytes bytes without reading them.
ReadByte
public byte ReadByte();ReadBool
public bool ReadBool();ReadSByte
public sbyte ReadSByte();ReadUShort
public ushort ReadUShort();ReadShort
public short ReadShort();ReadUInt
public uint ReadUInt();ReadInt
public int ReadInt();ReadULong
public ulong ReadULong();ReadLong
public long ReadLong();ReadFloat
public float ReadFloat();ReadDouble
public double ReadDouble();ReadString
public string ReadString();ReadBytesSegment
public ArraySegment<byte> ReadBytesSegment();Length-prefixed blob. Returns a segment into the underlying buffer - copy if you keep it.
ReadBytes
public byte[] ReadBytes();ReadRemaining
public ArraySegment<byte> ReadRemaining();ReadVector2
public Vector2 ReadVector2();ReadVector3
public Vector3 ReadVector3();ReadQuaternion
public Quaternion ReadQuaternion();ReadHalf
public float ReadHalf();ReadCompressedQuaternion
public Quaternion ReadCompressedQuaternion();ReadColor
public Color ReadColor();