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
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidSimple unit testing.intread()OverrideFilterReader.read().intread(char[] cbuf, int off, int len) OverrideFilterReader.read(char[], int, int).Methods inherited from class java.io.FilterReader
close, mark, markSupported, ready, reset, skipMethods inherited from class java.io.Reader
nullReader, read, read, transferTo
-
Constructor Details
-
UnicodeUnescapeReader
- Parameters:
in-
-
-
Method Details
-
read
OverrideFilterReader.read().- Overrides:
readin classFilterReader- Throws:
UnicodeUnescapeException- Invalid escape sequence encounteredIOException
-
read
OverrideFilterReader.read(char[], int, int).- Overrides:
readin classFilterReader- Throws:
IOException
-
main
Simple unit testing.- Throws:
IOException
-