title: How to create a BMP file from raw byte[] in Java
body: <p>I have a C++ application which communicates with a camera and  fetches raw image-data.
  I then have a Byte[] in C++, which i want to send to Java with JNI.</p>
  
  <p>However, i need to convert the raw Byte[] to an real file format(.bmp was my first choice).
  I can easily do this if i write it from C++ to an file on the hard-drive, using BITMAPFILEINFO and BITMAPHEADERINFO, but i do not know how one would go about sending the entire-format to Java.</p>
  
  <p>Then i thought about sending only the raw byte[] data using JNI and then converting it to 
  .bmp, but i can't seem to find any good library for doing this in Java.</p>
  
  <p>What would be my best choice? Converting the image in C++ and then sending it using JNI or send the RAW data to Java and then convert it to .bmp? How would i easiest achieve this?</p>