Package org.codehaus.janino
Class UnicodeUnescapeReader
- java.lang.Object
-
- java.io.Reader
-
- java.io.FilterReader
-
- org.codehaus.janino.UnicodeUnescapeReader
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Readable
public class UnicodeUnescapeReader extends java.io.FilterReader
AFilterReader
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
-derivedUnicodeUnescapeException
.
-
-
Constructor Summary
Constructors Constructor Description UnicodeUnescapeReader(java.io.Reader in)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
main(java.lang.String[] args)
Simple unit testing.int
read()
OverridesFilterReader.read()
.int
read(char[] cbuf, int off, int len)
OverridesFilterReader.read(char[], int, int)
.
-
-
-
Method Detail
-
read
public int read() throws java.io.IOException
OverridesFilterReader.read()
.- Overrides:
read
in classjava.io.FilterReader
- Throws:
UnicodeUnescapeException
- Invalid escape sequence encounteredjava.io.IOException
-
read
public int read(@Nullable char[] cbuf, int off, int len) throws java.io.IOException
OverridesFilterReader.read(char[], int, int)
.- Overrides:
read
in classjava.io.FilterReader
- Throws:
java.io.IOException
-
main
public static void main(java.lang.String[] args) throws java.io.IOException
Simple unit testing.- Throws:
java.io.IOException
-
-