Search this API

y.io.graphml
Class Base64

java.lang.Object
  extended by y.io.graphml.Base64

public class Base64
extends java.lang.Object

Static helper class that converts byte arrays from and to BASE64 encoded strings.

 

Method Summary
static byte[] decode(java.lang.String str)
          Decodes a BASE64 encoded String to a byte array.
static java.lang.String encode(byte[] source)
          Encodes a byte array into a BASE64 encoded String representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

encode

public static final java.lang.String encode(byte[] source)
Encodes a byte array into a BASE64 encoded String representation.

Parameters:
source - The bytes to convert.
Returns:
A BASE64 encoded String or an empty String if input was null or empty.

decode

public static final byte[] decode(java.lang.String str)
Decodes a BASE64 encoded String to a byte array.

Parameters:
str - The source string.
Returns:
The decoded array of bytes. The array is empty if str is null or has length 0.
Throws:
{@link - IllegalArgumentException} if any non convertible characters (except for line breaks and padding symbols) are found in the input

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.