• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Saving a byteArray in XML and retrieving it in Java

 
Greenhorn
Posts: 17
Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey all,
My aim is to convert a jpeg image into byte array and encode it using Base64. Now i have a encoded string. This I write to a XML file as a string field(Name of the field in my XML file is <data>). Now I should get the byte array back to reconstruct the image
I read the XML file extract the <data> field. As its a mere string, I thought using getBytes() on it will return me a byte array. Yes it does return a byte array. But am not able to reconstruct the image. Where am I going wrong?
 
Dic scott
Greenhorn
Posts: 17
Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
oops! I fixed it folks! only when I was typing my problem, I realized that I dint decode the B64 data anywhere in my java code! CodeRanch helps
 
reply
    Bookmark Topic Watch Topic
  • New Topic