Esri Geoportal Server
1.0

com.esri.gpt.server.csw.client
Class Base64

java.lang.Object
  extended by com.esri.gpt.server.csw.client.Base64

public class Base64
extends Object

Handles base64 encoding/decoding.


Method Summary
static byte[] decode(byte[] data)
          This method decodes the given byte array using the base64 encoding specified in RFC-2045 (Section 6.8).
static String decode(String data, String charset)
          This method decodes the given string using the base64 encoding specified in RFC-2045 (Section 6.8).
static byte[] encode(byte[] data)
          This method encodes the given byte array using the base64 encoding specified in RFC-2045 (Section 6.8).
static String encode(String data, String charset)
          This method encodes the given string using the base64 encoding specified in RFC-2045 (Section 6.8).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

encode

public static final byte[] encode(byte[] data)
This method encodes the given byte array using the base64 encoding specified in RFC-2045 (Section 6.8).

Parameters:
data - the data to encode
Returns:
the base64 encoded data

encode

public static final String encode(String data,
                                  String charset)
                           throws UnsupportedEncodingException
This method encodes the given string using the base64 encoding specified in RFC-2045 (Section 6.8). It's used for example in the "Basic" authorization scheme.

Parameters:
data - the string to encode
charset - the character set (if not supplied UTF-8 will be used)
Returns:
the base64 encoded string
Throws:
UnsupportedEncodingException - if the exception occurs

decode

public static final byte[] decode(byte[] data)
This method decodes the given byte array using the base64 encoding specified in RFC-2045 (Section 6.8).

Parameters:
data - the base64 encoded data.
Returns:
the decoded data.

decode

public static final String decode(String data,
                                  String charset)
                           throws UnsupportedEncodingException
This method decodes the given string using the base64 encoding specified in RFC-2045 (Section 6.8).

Parameters:
data - the base64 encoded string.
charset - the character set (if not supplied UTF-8 will be used)
Returns:
the decoded string
Throws:
UnsupportedEncodingException - if the exception occurs

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.