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, skippublic UnicodeUnescapeReader(Reader in)
in - public int read()
throws IOException
FilterReader.read().read in class FilterReaderUnicodeUnescapeException - Invalid escape sequence encounteredIOExceptionpublic int read(char[] cbuf,
int off,
int len)
throws IOException
FilterReader.read(char[], int, int).read in class FilterReaderIOExceptionpublic static void main(String[] args) throws IOException
IOExceptionCopyright © 2001–2013. All rights reserved.