com.iplanet.jato.util
Class Http64Encoder

java.lang.Object
  |
  +--sun.misc.CharacterEncoder
        |
        +--com.iplanet.jato.util.Http64Encoder

public class Http64Encoder
extends sun.misc.CharacterEncoder

This class encodes characters using a variant of Base64 encoding that results in an encoded string that doesn't need to be escaped for use in HTTP URLs. Specifically, the following characters are remapped in this implementation:

 Location  Base64  Http64
 --------  ------  ------
   62        +       -
   63        /       _
  (pad)      =       $
 
The Base64 implementation relies on the sun.misc.* package included with Sun's implementation of the Java Platform; there is no guarantee that this implementation will be used in future versions of this class.

Version:
JATO/1.2.2 $Id: Http64Encoder.java,v 1.5 2002/03/16 03:26:38 todd Exp $

Fields inherited from class sun.misc.CharacterEncoder
pStream
 
Constructor Summary
Http64Encoder()
          Default constructor
 
Method Summary
protected  int bytesPerAtom()
           
protected  int bytesPerLine()
           
protected  void encodeAtom(java.io.OutputStream outStream, byte[] data, int offset, int len)
          enocodeAtom - Take three bytes of input and encode it as 4 printable characters.
protected  void encodeLineSuffix(java.io.OutputStream aStream)
           
 
Methods inherited from class sun.misc.CharacterEncoder
encode, encode, encode, encodeBuffer, encodeBuffer, encodeBuffer, encodeBufferPrefix, encodeBufferSuffix, encodeLinePrefix, readFully
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Http64Encoder

public Http64Encoder()
Default constructor
Method Detail

bytesPerAtom

protected int bytesPerAtom()
Overrides:
bytesPerAtom in class sun.misc.CharacterEncoder

bytesPerLine

protected int bytesPerLine()
Overrides:
bytesPerLine in class sun.misc.CharacterEncoder

encodeLineSuffix

protected void encodeLineSuffix(java.io.OutputStream aStream)
                         throws java.io.IOException
Overrides:
encodeLineSuffix in class sun.misc.CharacterEncoder

encodeAtom

protected void encodeAtom(java.io.OutputStream outStream,
                          byte[] data,
                          int offset,
                          int len)
                   throws java.io.IOException
enocodeAtom - Take three bytes of input and encode it as 4 printable characters. Note that if the length in len is less than three is encodes either one or two '=' signs to indicate padding characters.
Overrides:
encodeAtom in class sun.misc.CharacterEncoder