public class UnicodeUnescapeReader extends FilterReader
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
.
in
Constructor and Description |
---|
UnicodeUnescapeReader(Reader in) |
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args)
Simple unit testing.
|
int |
read()
Override
FilterReader.read() . |
int |
read(char[] cbuf,
int off,
int len)
Override
FilterReader.read(char[], int, int) . |
close, mark, markSupported, ready, reset, skip
public UnicodeUnescapeReader(Reader in)
in
- public int read() throws IOException
FilterReader.read()
.read
in class FilterReader
UnicodeUnescapeException
- Invalid escape sequence encounteredIOException
public int read(char[] cbuf, int off, int len) throws IOException
FilterReader.read(char[], int, int)
.read
in class FilterReader
IOException
public static void main(String[] args) throws IOException
IOException
Copyright © 2001–2014. All rights reserved.