Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Binary data to Image File

 
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
 
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.
 
Bartender
Posts: 9559
12
Mac OS X Linux 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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!