public class

Base64

extends Object
java.lang.Object
   ↳ com.neomades.util.Base64

Class Overview

Utilities for encoding and decoding the Base64 representation of binary data.

Summary

Public Constructors
Base64()
Public Methods
static byte[] decode(String input)
Decodes the Base64-encoded data in input and return the data in a new byte array.
static String encode(byte[] input)
Base64 encodes the given data and return a newly allocated String with the result.
static String encode(byte[] input, int offset, int len)
Base64 encodes the given data and return a newly allocated String with the result.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Base64 ()

Public Methods

public static byte[] decode (String input)

Decodes the Base64-encoded data in input and return the data in a new byte array.

Parameters
input the input String to decode, which is converted to bytes using the default charset
Returns
  • the data in a new byte array
Throws
NullPointerException if input is null

public static String encode (byte[] input)

Base64 encodes the given data and return a newly allocated String with the result.

Parameters
input the data to encode
Returns
  • a newly allocated String with the result
Throws
NullPointerException if input is null

public static String encode (byte[] input, int offset, int len)

Base64 encodes the given data and return a newly allocated String with the result.

Parameters
input the data to encode
offset the position within the input array at which to start
len the number of bytes of input to encode
Returns
  • a newly allocated String with the result
Throws
NullPointerException if input is null
ArrayIndexOutOfBoundsException if offset or len are outside input bounds