Package org.codehaus.janino
Class UnicodeUnescapeReader
- java.lang.Object
-
- java.io.Reader
-
- java.io.FilterReader
-
- org.codehaus.janino.UnicodeUnescapeReader
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Readable
public class UnicodeUnescapeReader extends FilterReader
AFilterReaderthat 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-derivedUnicodeUnescapeException.
-
-
Field Summary
-
Fields inherited from class java.io.FilterReader
in
-
-
Constructor Summary
Constructors Constructor Description UnicodeUnescapeReader(Reader in)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidmain(String[] args)Simple unit testing.intread()OverrideFilterReader.read().intread(char[] cbuf, int off, int len)OverridesFilterReader.read(char[], int, int).-
Methods inherited from class java.io.FilterReader
close, mark, markSupported, ready, reset, skip
-
Methods inherited from class java.io.Reader
nullReader, read, read, transferTo
-
-
-
-
Constructor Detail
-
UnicodeUnescapeReader
public UnicodeUnescapeReader(Reader in)
-
-
Method Detail
-
read
public int read() throws IOExceptionOverrideFilterReader.read().- Overrides:
readin classFilterReader- Throws:
UnicodeUnescapeException- Invalid escape sequence encounteredIOException
-
read
public int read(char[] cbuf, int off, int len) throws IOExceptionOverridesFilterReader.read(char[], int, int).- Overrides:
readin classFilterReader- Throws:
IOException
-
main
public static void main(String[] args) throws IOException
Simple unit testing.- Throws:
IOException
-
-