ozone core API

org.ozoneDB.util
Class MimeBase64Encoder

java.lang.Object
  |
  +--org.ozoneDB.util.MimeBase64Encoder

public final class MimeBase64Encoder
extends java.lang.Object

Byte to text encoder using base 64 encoding. To create a base 64 encoding of a byte stream call translate(byte[]) for every sequence of bytes and getCharArray() to mark closure of the byte stream and retrieve the text presentation.

Author:
Based on code from the Mozilla Directory SDK

Field Summary
private  int buf
           
private  int buf_bytes
           
private static byte[] crlf
           
private  char[] line
           
private  int line_length
           
private static char[] map
           
private  java.lang.StringBuffer out
           
 
Constructor Summary
MimeBase64Encoder()
           
 
Method Summary
private  void encode_partial_token()
           
private  void encode_token()
           
private  void flush_line()
           
 char[] getCharArray()
           
 void translate(byte[] in)
          Given a sequence of input bytes, produces a sequence of output bytes using the base64 encoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

private java.lang.StringBuffer out

buf

private int buf

buf_bytes

private int buf_bytes

line

private char[] line

line_length

private int line_length

crlf

private static final byte[] crlf

map

private static final char[] map
Constructor Detail

MimeBase64Encoder

public MimeBase64Encoder()
Method Detail

encode_token

private final void encode_token()

encode_partial_token

private final void encode_partial_token()

flush_line

private final void flush_line()

translate

public final void translate(byte[] in)
Given a sequence of input bytes, produces a sequence of output bytes using the base64 encoding. If there are bytes in `out' already, the new bytes are appended, so the caller should do `out.setLength(0)' first if that's desired.


getCharArray

public char[] getCharArray()

ozone core API

Copyright (C) The Ozone Database Project - www.ozone-db.org. All rights reserved.