Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Binary data to Image File  RSS feed

 
rutvi gen
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to convert Binary data in to Image file.
Actually, i have converted an image file to binary data and send it to a server.and that is my custom server and from here i need to send image to web server.
and from custom server to image server i have to send image File rather than binary data.
so, is it possible to convert BINARY DATA in to IMAGE FILE?

If yes then please tell how and if possible then sample code.


thanks
 
Thomas Thevis
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at javax.imageio.ImageIO. It cnvertes images to files and vice versa.
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javax.imageio.ImageIO is useful for reading/writing images to/from java objects, like BufferedImage.
If Rutvi "converted" the image file to "binary data" by reading the bytes from a stream into a byte array, he can just write the data back out with a stream.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!