/// <summary> /// Creates a new ReadWrapper that wraps the state used to read a message from a stream. /// </summary> /// <param name="stream">The stream being read.</param> public ReadWrapper(NetworkStream stream) { this.ReadState = ConnectionReadState.Header; this.Buffer = new byte[BufferSize]; this.MessageBytes = new List <byte>(); this.TotalBytes = 1; // default to header read size. this.NextReadSize = this.TotalBytes; this.Stream = stream; }
/// <summary> /// Creates a new ReadWrapper that wraps the state used to read a message from a stream. /// </summary> /// <param name="stream">The stream being read.</param> public ReadWrapper(NetworkStream stream) { this.ReadState = ConnectionReadState.Header; this.Buffer = new byte[BufferSize]; this.MessageBytes = new List<byte>(); this.TotalBytes = 1; // default to header read size. this.NextReadSize = this.TotalBytes; this.Stream = stream; }