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());
        }
 private void Reset()
 {
     header = new FrameHeader();
     payload.Clear();
 }