asia.redact.bracket.util
Class NativeToAsciiFilter

java.lang.Object
  extended by asia.redact.bracket.util.NativeToAsciiFilter

public class NativeToAsciiFilter
extends Object

Assuming the input is to be understood as ASCII, encode bytes above 127 as unicode escapes like \\uXXXX. Rework of the Sun open source code to use a StringBuffer instead of a stream.

Author:
Dave

Field Summary
(package private)  String lineBreak
           
(package private)  StringBuffer out
           
 
Constructor Summary
NativeToAsciiFilter()
           
NativeToAsciiFilter(StringBuffer buf)
           
 
Method Summary
 String getResult()
           
 NativeToAsciiFilter write(char[] buf)
           
 NativeToAsciiFilter write(char[] buf, int off, int len)
           
 NativeToAsciiFilter write(String str)
           
 NativeToAsciiFilter write(String str, int off, int len)
          Writes a portion of a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lineBreak

final String lineBreak

out

StringBuffer out
Constructor Detail

NativeToAsciiFilter

public NativeToAsciiFilter()

NativeToAsciiFilter

public NativeToAsciiFilter(StringBuffer buf)
Method Detail

write

public NativeToAsciiFilter write(char[] buf)

write

public NativeToAsciiFilter write(String str)

write

public NativeToAsciiFilter write(char[] buf,
                                 int off,
                                 int len)

write

public NativeToAsciiFilter write(String str,
                                 int off,
                                 int len)
                          throws IOException
Writes a portion of a string.

Parameters:
str - String to be written
off - Offset from which to start reading characters
len - Number of characters to be written
Throws:
IOException - If an I/O error occurs

getResult

public String getResult()


Copyright © 2011-2013 David R. Smith. All Rights Reserved.