Solved

Convert String from base64 to base32

Posted on 2002-06-10
6
529 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
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Weekend adv creator 3 38
JavaScript/Java - Changing an image background color 4 67
javap bin 2 34
Detect Closed Loops (circles, figure-8s, etc) in PNG Images 6 33
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

809 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