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.
-
ASCIIEncoder(CharConsumer, String)
- Creates a ASCIIEncoder with the specified output destination and
specified special characters.
-
toHex(CharConsumer, int, int)
-
-
write(CharProducer)
-
-
write(int)
-
-
writeEscapeWhite(int)
-
-
writeSpecial(int)
- Writes the character without escapes.
-
writeUNICODE(int)
- Writes the character using the UNICODE escape sequence \\uxxxx
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.
write
public void write(CharProducer in) throws IOException
write
public void write(int c) throws IOException
writeEscapeWhite
public void writeEscapeWhite(int c) throws IOException
writeSpecial
public void writeSpecial(int c) throws IOException
- Writes the character without escapes.
- Parameters:
- c - a printable ASCII character.
writeUNICODE
protected void writeUNICODE(int c) throws IOException
- Writes the character using the UNICODE escape sequence \\uxxxx
toHex
public void toHex(CharConsumer out,
int value,
int numDigits) throws IOException
All Packages Class Hierarchy This Package Previous Next Index