Solved

Bas64 usage

Posted on 2004-08-29
2
316 Views
Last Modified: 2008-02-01
Hello All,

I would like to conver bytes to Bas64 content or vice versa

How can i do that

Thanks
0
Comment
Question by:iknowit75
  • 2
2 Comments
 
LVL 14

Accepted Solution

by:
sudhakar_koundinya earned 125 total points
Comment Utility
This example uses non-standard classes in the sun.misc package to convert to and from Base64. These classes may change in the future.

    try {
        // Convert a byte array to base64 string
        byte[] buf = new byte[]{0x41, 0x42};
        String s = new sun.misc.BASE64Encoder().encode(buf);
   
        // Convert base64 string to a byte array
        buf = new sun.misc.BASE64Decoder().decodeBuffer(s);
    } catch (IOException e) {
    }
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
Comment Utility
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
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 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…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

771 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