Solved

Convert String from base64 to base32

Posted on 2002-06-10
6
517 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to implement Singleton Design Pattern in Java.

760 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

20 Experts available now in Live!

Get 1:1 Help Now