mirror of
https://github.com/Dadechin/Unity-WebSocket.git
synced 2025-07-03 20:04:33 +00:00
26 lines
708 B
C#
26 lines
708 B
C#
namespace FishNet.Serializing
|
|
{
|
|
|
|
public partial class Reader
|
|
{
|
|
/// <summary>
|
|
/// Reads a substream. Start reading from it with StartReading method.
|
|
/// </summary>
|
|
/// <returns>Returns SubStream</returns>
|
|
public SubStream ReadSubStream()
|
|
{
|
|
// read length of subStream
|
|
int streamLength = ReadInt32();
|
|
|
|
// if length is -1, it is invalid
|
|
if (streamLength == SubStream.UNINITIALIZED_LENGTH)
|
|
{
|
|
// returns Uninitialized SubStream
|
|
return SubStream.GetUninitialized();
|
|
}
|
|
|
|
return SubStream.CreateFromReader(this, streamLength);
|
|
}
|
|
}
|
|
|
|
} |