xmlBlaster 2.2.0 client API

org.xmlBlaster.util
Class Base64

java.lang.Object
  extended by org.xmlBlaster.util.Base64

public class Base64
extends java.lang.Object


Constructor Summary
Base64()
           
 
Method Summary
static byte[] decode(byte[] b)
           
static byte[] decode(java.lang.String s)
          Decodes the given Base64 encoded String to a new byte array.
static java.lang.String encode(byte[] data)
           
static java.lang.StringBuffer encode(byte[] data, int start, int len, java.lang.StringBuffer buf)
          Encodes the part of the given byte array denoted by start and len to the Base64 format.
static void main(java.lang.String[] args)
          java org.xmlBlaster.util.Base64 -file MyFile.jpg java org.xmlBlaster.util.Base64 HelloWorld -> SGVsbG9Xb3JsZA== java org.xmlBlaster.util.Base64 -decodeFile MyFile.base64 java org.xmlBlaster.util.Base64 -decode Q2lBOGEyVjVJRzlwWkQwblNHVnNiRzhuSUdOdmJuUmxiblJOYVcxbFBTZDBaWGgwTDNodGJDY2dZMjl1ZEdWdWRFMXBiV1ZGZUhSbGJtUmxaRDBuTVM0d0p6NEtJQ0E4YjNKbkxuaHRiRUpzWVhOMFpYSStQR1JsYlc4dE16NDhMMlJsYlc4dE16NDhMMjl5Wnk1NGJXeENiR0Z6ZEdWeVBnb2dQQzlyWlhrKw==
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Base64

public Base64()
Method Detail

encode

public static java.lang.String encode(byte[] data)

encode

public static java.lang.StringBuffer encode(byte[] data,
                                            int start,
                                            int len,
                                            java.lang.StringBuffer buf)
Encodes the part of the given byte array denoted by start and len to the Base64 format. The encoded data is appended to the given StringBuffer. If no StringBuffer is given, a new one is created automatically. The StringBuffer is the return value of this method.


decode

public static byte[] decode(byte[] b)

decode

public static byte[] decode(java.lang.String s)
Decodes the given Base64 encoded String to a new byte array. The byte array holding the decoded data is returned.

Returns:
never null

main

public static void main(java.lang.String[] args)
                 throws XmlBlasterException
java org.xmlBlaster.util.Base64 -file MyFile.jpg java org.xmlBlaster.util.Base64 HelloWorld -> SGVsbG9Xb3JsZA== java org.xmlBlaster.util.Base64 -decodeFile MyFile.base64 java org.xmlBlaster.util.Base64 -decode Q2lBOGEyVjVJRzlwWkQwblNHVnNiRzhuSUdOdmJuUmxiblJOYVcxbFBTZDBaWGgwTDNodGJDY2dZMjl1ZEdWdWRFMXBiV1ZGZUhSbGJtUmxaRDBuTVM0d0p6NEtJQ0E4YjNKbkxuaHRiRUpzWVhOMFpYSStQR1JsYlc4dE16NDhMMlJsYlc4dE16NDhMMjl5Wnk1NGJXeENiR0Z6ZEdWeVBnb2dQQzlyWlhrKw==

Throws:
XmlBlasterException

xmlBlaster 2.2.0 client API

Copyright © 1999-2014 The xmlBlaster.org contributers.