I meant that I'm unable to open the picture in some viewer, not in the j2se app. The FileImageOutputStream creates the .png file, there is no exception thrown. I guess it's just not in the right encoding.
Btw, the FileImageOutputStream creates a .png file with size twice as big as the length of the array of bytes I'm sending from midlet.
When I'm using BufferedWriter, the size of image.png is the same as the length of the array of bytes I'm sending from midlet.
File outputfile = new File("pic.png");
FileImageOutputStream fios = new FileImageOutputStream(outputfile);
fios.writeChars(buf.toString()); // i'm receiving the data into StringBuffer
Something tells me, that when the captured image has 0,5 MB, it should not have 1 MB after creating the same image from array of bytes in the PC.
BufferedWriter bw = new BufferedWriter(new FileWriter(new File("image.png")));
bw.write(buf.toString()); // i'm receiving the data into StringBuffer