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 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 java.io.FilterReader
in
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Simple unit testing.int
read()
OverridesFilterReader.read()
.int
read
(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
-
Field Details
-
unreadChar
private int unreadChar -
oddPrecedingBackslashes
private boolean oddPrecedingBackslashes
-
-
Constructor Details
-
UnicodeUnescapeReader
-
-
Method Details
-
read
OverridesFilterReader.read()
.- Overrides:
read
in classFilterReader
- Throws:
UnicodeUnescapeException
- Invalid escape sequence encounteredIOException
-
read
OverridesFilterReader.read(char[], int, int)
.- Overrides:
read
in classFilterReader
- Throws:
IOException
-
main
Simple unit testing.- Throws:
IOException
-