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
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

### Fields inherited from class java.io.FilterReader

`in`

### Fields inherited from class java.io.Reader

`lock`

## Constructor Summary

Constructors
Constructor
Description
`UnicodeUnescapeReader(Reader in)`

## Method Summary

Modifier and Type
Method
Description
`static void`
`main(String[] args)`
Simple unit testing.
`int`
`read()`
Overrides `FilterReader.read()`.
`int`
`read(char[] cbuf, int off, int len)`
Overrides `FilterReader.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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### UnicodeUnescapeReader

public UnicodeUnescapeReader(Reader in)

## Method Details

### read

public int read() throws IOException
Overrides `FilterReader.read()`.

Overrides:
  `read` in class `FilterReader`
Throws:
  `UnicodeUnescapeException` - Invalid escape sequence encountered
  `IOException`

### read

public int read(@Nullable char[] cbuf, int off, int len) throws IOException
Overrides `FilterReader.read(char[], int, int)`.

Overrides:
  `read` in class `FilterReader`
Throws:
  `IOException`

### main

public static void main(String[] args) throws IOException
Simple unit testing.

Throws:
  `IOException`