[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 375
  • Last Modified:

Bas64 usage

Hello All,

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

How can i do that

Thanks
0
iknowit75
Asked:
iknowit75
  • 2
1 Solution
 
sudhakar_koundinyaCommented:
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
 
sudhakar_koundinyaCommented:
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now