Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 602
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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