Пример #1
0
        internal byte[] ToBytes()
        {
            var header = new FrameHeader();
            header.OpCode = OpCode;
            header.PayloadSize = (ulong)Payload.Length;

            var segments = new List<byte[]>();
            segments.Add(header.ToBytes());
            segments.Add(Payload);
            return (segments.SelectMany(f => f).ToArray());
        }
Пример #2
0
 private void Reset()
 {
     header = new FrameHeader();
     payload.Clear();
 }