com.codestreet.messageforge
Class RBase64

java.lang.Object
  extended bycom.codestreet.messageforge.RBase64

public abstract class RBase64
extends java.lang.Object

Base64 encoder/decoder.

Author:
Jawaid Hakim.

Constructor Summary
RBase64()
           
 
Method Summary
static byte[] decode(char[] cs, int offset, int len)
          Decode a Base64 encoded char[].
static void decode(char[] cs, int offset, int len, java.io.OutputStream os)
           
static byte[] decode(java.lang.String string)
          Decode a Base64 encoded String.
static void decode(java.lang.String string, java.io.OutputStream os)
          Decode a Base64 encoded String and write to OutputStream.
static java.lang.String encode(byte[] data)
          Encode a byte array as a Base64 encoded String.
static java.lang.String encode(byte[] data, int offset, int len)
          Encode a byte array as a Base64 encoded String.
static void encode(byte[] data, int offset, int len, java.io.OutputStream os)
          Encode a byte array as to Base64 to write to an OutputStream.
static void encode(byte[] data, int offset, int len, java.io.Writer writer)
          Encode a byte array as to Base64 to write to an Writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RBase64

public RBase64()
Method Detail

decode

public static byte[] decode(java.lang.String string)
Decode a Base64 encoded String.

Parameters:
string - Base64 encoded String.
Returns:
Byte array.

decode

public static void decode(java.lang.String string,
                          java.io.OutputStream os)
                   throws java.io.IOException
Decode a Base64 encoded String and write to OutputStream.

Parameters:
string - Base64 encoded String.
os - Output stream.
Throws:
java.io.IOException

decode

public static byte[] decode(char[] cs,
                            int offset,
                            int len)
Decode a Base64 encoded char[].

Parameters:
cs - Base64 encoded chatacter array.
offset - Offset.
len - Length.
Returns:
Byte array.

decode

public static void decode(char[] cs,
                          int offset,
                          int len,
                          java.io.OutputStream os)
                   throws java.io.IOException
Throws:
java.io.IOException

encode

public static java.lang.String encode(byte[] data)
Encode a byte array as a Base64 encoded String.

Parameters:
data - Byte array.
Returns:
Base64 encoded String.

encode

public static java.lang.String encode(byte[] data,
                                      int offset,
                                      int len)
Encode a byte array as a Base64 encoded String.

Parameters:
data - Byte array.
offset - Offset.
len - Length.
Returns:
Base64 encoded String.

encode

public static void encode(byte[] data,
                          int offset,
                          int len,
                          java.io.OutputStream os)
                   throws java.io.IOException
Encode a byte array as to Base64 to write to an OutputStream.

Parameters:
data - Byte array.
offset - Offset.
len - Length.
os - Output stream.
Throws:
java.io.IOException

encode

public static void encode(byte[] data,
                          int offset,
                          int len,
                          java.io.Writer writer)
                   throws java.io.IOException
Encode a byte array as to Base64 to write to an Writer.

Parameters:
data - Byte array.
offset - Offset.
len - Length.
writer - Writer.
Throws:
java.io.IOException


Copyright © 2003-2006 CodeStreet. All Rights Reserved.