Class COM.ibm.jaws.motk.ASCIIEncoder
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.ibm.jaws.motk.ASCIIEncoder

java.lang.Object
   |
   +----COM.ibm.jaws.motk.ASCIIEncoder

public class ASCIIEncoder
extends Object
implements CharConsumer
Converts Java characters to 7-bit printable ASCII, using standard escapes for newline, tab, formfeed, and return. Converts any other non-printable character to the form \\uxxxx where xxxx is the hex encoding of the character value. Any designated special character will also be escaped unless it is written with the writeSpecial method.

Constructor Index

 o ASCIIEncoder(CharConsumer, String)
Creates a ASCIIEncoder with the specified output destination and specified special characters.

Method Index

 o toHex(CharConsumer, int, int)
 o write(CharProducer)
 o write(int)
 o writeEscapeWhite(int)
 o writeSpecial(int)
Writes the character without escapes.
 o writeUNICODE(int)
Writes the character using the UNICODE escape sequence \\uxxxx

Constructors

 o ASCIIEncoder
  public ASCIIEncoder(CharConsumer out,
                      String specials)
Creates a ASCIIEncoder with the specified output destination and specified special characters.
Parameters:
out - the output destination, need only support 7-bit printable ASCII.
specials - the special characters, each must be a printable ASCII character.

Methods

 o write
  public void write(CharProducer in) throws IOException
 o write
  public void write(int c) throws IOException
 o writeEscapeWhite
  public void writeEscapeWhite(int c) throws IOException
 o writeSpecial
  public void writeSpecial(int c) throws IOException
Writes the character without escapes.
Parameters:
c - a printable ASCII character.
 o writeUNICODE
  protected void writeUNICODE(int c) throws IOException
Writes the character using the UNICODE escape sequence \\uxxxx
 o toHex
  public void toHex(CharConsumer out,
                    int value,
                    int numDigits) throws IOException

All Packages  Class Hierarchy  This Package  Previous  Next  Index