• 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

need to convert image to byte[]

Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

This post is a continuation of a conversation from a
previous post concerning images and xml

My original query asked, "how do you move image data over a network using xml?"
Image data is, of course, binary data. Therefore, I didn't even know if you could convert it somehow into character data to fit into an xml document, sent over the network, then reassembled at the other end.
It was suggested I look at using Base64 to encode and decode the image data.
So, I put together a small test app (see below) to test this theory. The problem however, comes in when I have to convert the image from ImageIcon to a byte[] array. If you look at the example code you can see where I'm stuck.

Any help would be appreciated.


[ November 15, 2007: Message edited by: Alan Shiers ]
Posts: 3742
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has some suggestions.

As does this.

And this

All of which were found quickly by doing this.
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joanne, you wouldn't have been able to find

or this

or even this

if someone or some people at some point hadn't asked a question about something they didn't know how to do. So don't be a such a jerk. If you don't want to answer a question then don't. If people didn't ask questions you wouldn't be able to find this.
[ May 22, 2008: Message edited by: Brandon Broschinsky ]
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Brandon,

without having looked at the linked content from Joanne's post, I'd assume that it might in fact be helpful to the original poster. I also don't see anything wrong with telling him how he can find such things faster by himself in the future. I also didn't see any name calling in the post - all in all, it didn't look un-nice to me, even if a bit shortspoken.

So I'm not sure what you are so upset about. I'd suggest, though, that you might be more successful by being a role model of the behavior you'd like to see. Whatever you do, please respect our Be Nice rule. Thanks!
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!