Solved

Convert String from base64 to base32

Posted on 2002-06-10
6
568 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
This video teaches viewers about errors in exception handling.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

636 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