org.jboss.errai.common.client.util
Class Base64Util
java.lang.Object
org.jboss.errai.common.client.util.Base64Util
public class Base64Util
- extends Object
Base64 String to-and-from byte array utility.
This code is a modified version of Base64Encoder from the gwt-crypto project, used under the terms of the ASL 2.0 license.
- Author:
- gwt-crypto project (original encode/decode logic), Jonathan Fuerth (modified for Errai by removing
usage of java.io)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
padding
protected static final byte padding
- See Also:
- Constant Field Values
decodingTable
protected static final byte[] decodingTable
Base64Util
public Base64Util()
encode
public static String encode(Byte[] data,
int off,
int length)
- Same as
encode(byte[], int, int)
but accepts an array of boxed
Byte values.
- Parameters:
data
- The sequence of bytes to encode. Every element must be non-null.off
- The offset into the data array to start encoding fromlength
- The number of bytes to encode, starting from off
- Returns:
- The base64 encoded data.
encode
public static String encode(byte[] data,
int off,
int length)
- Encodes the input data, producing a base 64 string.
- Parameters:
data
- the data to encode. It is assumed that none of the elements are
null.off
- The offset into the data array to start encoding fromlength
- The number of bytes to encode, starting from off
- Returns:
- the base64 representation of the given binary data.
decodeAsBoxed
public static Byte[] decodeAsBoxed(String data)
decode
public static byte[] decode(String data)
- Decodes the Base64-encoded String to the equivalent binary data array.
Whitespace characters in the input stream are ignored.
- Returns:
- the binary data decoded from the input string
Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.