title: Image transfer between C++ and Java via Socket
body: <p>I would like to transfer an image from a <strong>Java</strong> application to a <strong>C++</strong> application. I am using sockets as the communication method, and for now this works good with strings.</p>
  
  <p>I want to be able to transmit it both way (Java &lt;-> C++).</p>
  
  <p>The image is NOT a file, this is a <strong>memory object/structure</strong>. So my main problem is how to encode the image for the transmission, so that it can be used in Java and in C++.</p>
  
  <p>The transfer is on the same machine (no network, so the speed isn't critical), but still the faster/more efficient, the better.</p>
  
  <p>Thank you</p>
  
  <p>Note : I am using OpenCV in C++, and the main goal is to process a webcam stream. I don't / can't use JavaCV or something like that !</p>