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