Solved

Convert String from base64 to base32

Posted on 2002-06-10
6
521 Views
Last Modified: 2012-05-04
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
Comment
Question by:houtexdev
  • 3
  • 3
6 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 7067996
Why do you need to convert to base32? Why not just decode it from base64?
0
 

Author Comment

by:houtexdev
ID: 7068348
I'm new to java....

How exactly would I do that?
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 300 total points
ID: 7068394
This is the general idea:

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

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:houtexdev
ID: 7068402
Is there a way to do it without interacting with the filesystem?  This is a multi-threaded server component on a web server.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 7068410
Can you show me how you're getting the XML doc in the first place?
0
 

Author Comment

by:houtexdev
ID: 7070821
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
network + 7 80
firstChar challenge 13 106
solarwind tftp server 2 44
Error trying to install RTMT Win7 5 38
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
The viewer will learn how to implement Singleton Design Pattern in Java.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now