Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

convert Image file to binary format and write these binary string to File.

807606Feb 25 2007 — edited Feb 25 2007
Hi,

I have a byte array which contains chart data which i write it file, but i want to convert this file or byte array to binary format and write it file.
byte[] data="";
String strdir = strCRRootPath+"/Charts";
				boolean success = (new File(strdir)).mkdirs();
				String newFileName = strdir+"/"+chartType+"_Chart_"+chartName+".jpeg";
				FileImageOutputStream imageOutput = new FileImageOutputStream(new File(newFileName));

				System.out.println(data);
				imageOutput.write(data, 0, data.length);
				imageOutput.close();
any suggestions or soultions will be highly appriciated.


Thanks in advance,

Rutvej
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 25 2007
Added on Feb 25 2007
2 comments
881 views