public void EncodeData(IOutputBuffer output, IList <ArraySegment <byte> > data) { var result = new List <ArraySegment <byte> >(data.Count); var lastIndex = data.Count - 1; for (var i = 0; i < data.Count; i++) { data[i] = EncodeData(i == 0 ? OpCode.Binary : OpCode.Continuation, i == lastIndex, data[i]); } output.AddRange(data); }
public void EncodeData(IOutputBuffer output, IList<ArraySegment<byte>> data) { var result = new List<ArraySegment<byte>>(data.Count); var lastIndex = data.Count - 1; for(var i = 0; i < data.Count; i++) { data[i] = EncodeData(i == 0 ? OpCode.Binary : OpCode.Continuation, i == lastIndex, data[i]); } output.AddRange(data); }