org.jasen.io
Class ByteToCharUTF7Converter

java.lang.Object
  extended bysun.io.ByteToCharConverter
      extended byorg.jasen.io.ByteToCharUTF7Converter

public class ByteToCharUTF7Converter
extends sun.io.ByteToCharConverter

ByteToCharUTF7Converter Converts UTF-7 encoded bytes into Unicode 16 chars.

This is required because as of the time of writing, the JDK does not include a UTF7 decoder, however this is quite a common encoding in RFC822 (MIME) messages.

Author:
Jason Polites

Field Summary
static String BASE64
           
 
Constructor Summary
ByteToCharUTF7Converter()
           
 
Method Summary
 int convert(byte[] bytes, int byteStart, int byteEnd, char[] chars, int charStart, int charEnd)
           
 int flush(char[] chars, int off, int len)
           
 String getCharacterEncoding()
           
 void reset()
           
 
Methods inherited from class sun.io.ByteToCharConverter
convertAll, getBadInputLength, getConverter, getDefault, getMaxCharsPerByte, nextByteIndex, nextCharIndex, setSubstitutionChars, setSubstitutionMode, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BASE64

public static final String BASE64
See Also:
Constant Field Values
Constructor Detail

ByteToCharUTF7Converter

public ByteToCharUTF7Converter()
Method Detail

getCharacterEncoding

public String getCharacterEncoding()

flush

public int flush(char[] chars,
                 int off,
                 int len)

reset

public void reset()

convert

public int convert(byte[] bytes,
                   int byteStart,
                   int byteEnd,
                   char[] chars,
                   int charStart,
                   int charEnd)
            throws sun.io.ConversionBufferFullException,
                   sun.io.UnknownCharacterException
Throws:
sun.io.ConversionBufferFullException
sun.io.UnknownCharacterException