org.codehaus.janino
Class UnicodeUnescapeReader
java.lang.Object
java.io.Reader
java.io.FilterReader
org.codehaus.janino.UnicodeUnescapeReader
- All Implemented Interfaces:
- Closeable, Readable
public class UnicodeUnescapeReader
- extends FilterReader
A FilterReader that unescapes the "Unicode Escapes" as described in JLS7 3.10.6.
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.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UnicodeUnescapeReader
public UnicodeUnescapeReader(Reader in)
read
public int read()
throws IOException
- Override
FilterReader.read().
- Overrides:
read in class FilterReader
- Throws:
UnicodeUnescapeException - Invalid escape sequence encountered
IOException
read
public int read(char[] cbuf,
int off,
int len)
throws IOException
- Overrides
FilterReader.read(char[], int, int).
- Overrides:
read in class FilterReader
- Throws:
IOException
main
public static void main(String[] args)
throws IOException
- Simple unit testing.
- Throws:
IOException