Web Site

org.codehaus.janino
Class UnicodeUnescapeReader

java.lang.Object
  extended by java.io.Reader
      extended by java.io.FilterReader
          extended by org.codehaus.janino.UnicodeUnescapeReader
All Implemented Interfaces:
java.io.Closeable, java.lang.Readable

public class UnicodeUnescapeReader
extends java.io.FilterReader

A FilterReader that unescapes the "Unicode Escapes" as described in the Java Language Specification, 2nd edition.

Notice that it is possible to formulate invalid escape sequences, e.g. "\u123g" ("g" is not a valid hex character). This is handled by throwing a RuntimeException-derived UnicodeUnescapeException.


Field Summary
 
Fields inherited from class java.io.FilterReader
in
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
UnicodeUnescapeReader(java.io.Reader in)
           
 
Method Summary
static void main(java.lang.String[] args)
          Simple unit testing.
 int read()
          Override FilterReader.read().
 int read(char[] cbuf, int off, int len)
          Override FilterReader.read(char[], int, int).
 
Methods inherited from class java.io.FilterReader
close, mark, markSupported, ready, reset, skip
 
Methods inherited from class java.io.Reader
read, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnicodeUnescapeReader

public UnicodeUnescapeReader(java.io.Reader in)
Parameters:
in -
Method Detail

read

public int read()
         throws java.io.IOException
Override FilterReader.read().

Overrides:
read in class java.io.FilterReader
Throws:
UnicodeUnescapeException - Invalid escape sequence encountered
java.io.IOException

read

public int read(char[] cbuf,
                int off,
                int len)
         throws java.io.IOException
Override FilterReader.read(char[], int, int).

Overrides:
read in class java.io.FilterReader
Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Simple unit testing.

Throws:
java.io.IOException

Web Site