title: Compress Mat into Jpeg And save the result into memory
body: <p>I know that the function <code>cv::imwrite</code> can compress a <code>cv::Mat</code> into Jpeg and save it to a file. But now I want to save it into memory, like a array of <code>uchar</code>. So, I can send the array to another one ,and it can write the data into a jpeg file. Is there any one can help me out?</p>