• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 696
  • Last Modified:

Convert String from base64 to base32

I have a function that expects a string with some special characters (tabs, spaces, line feeds, etc.)

I have an XML document that I'm retrieving from a web service which contains this data.  The data is in a base64 format because of the validation issues with xml, of course.  I can get the base64 string in to a variable.  how can I convert this string to base32 so that I can pass it off to my function?
0
houtexdev
Asked:
houtexdev
  • 3
  • 3
1 Solution
 
CEHJCommented:
Why do you need to convert to base32? Why not just decode it from base64?
0
 
houtexdevAuthor Commented:
I'm new to java....

How exactly would I do that?
0
 
CEHJCommented:
This is the general idea:

InputStream is=connection.getInputStream();
FileOutputStream fos= ...;
new sun.misc.BASE64Decoder().decodeBuffer(is,fos);

0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
houtexdevAuthor Commented:
Is there a way to do it without interacting with the filesystem?  This is a multi-threaded server component on a web server.
0
 
CEHJCommented:
Can you show me how you're getting the XML doc in the first place?
0
 
houtexdevAuthor Commented:
Never mind, I got off of my lazy a** and wrote a function to take care of it myself.  

Thanks for the help, though.  I'll give you the points
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now