net.jini.config
Class UnicodeEscapesDecodingReader

java.lang.Object
  extended by java.io.Reader
      extended by net.jini.config.UnicodeEscapesDecodingReader
All Implemented Interfaces:
Closeable, Readable

final class UnicodeEscapesDecodingReader
extends Reader

A Reader that converts Unicode escape sequences, throwing IOException for malformed escapes.

Since:
2.0
Author:
Sun Microsystems, Inc.

Field Summary
private  char[] code
          Buffer to hold the Unicode value being parsed.
private static int NO_CHAR
          Marker for when peekc is empty.
private  int peekc
          A peeked character -- the character after a backslash if it wasn't 'u' -- or NO_CHAR if no peek was done.
private  Reader reader
          The source of characters to translate.
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
UnicodeEscapesDecodingReader(Reader reader)
          Creates an instance of this class.
 
Method Summary
 void close()
           
 int read()
           
 int read(char[] cbuf, int off, int len)
           
private  int readInternal()
          Implements read() without checking if this reader is closed.
 
Methods inherited from class java.io.Reader
mark, markSupported, read, read, ready, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_CHAR

private static final int NO_CHAR
Marker for when peekc is empty.

See Also:
Constant Field Values

reader

private Reader reader
The source of characters to translate.


peekc

private int peekc
A peeked character -- the character after a backslash if it wasn't 'u' -- or NO_CHAR if no peek was done.


code

private final char[] code
Buffer to hold the Unicode value being parsed.

Constructor Detail

UnicodeEscapesDecodingReader

UnicodeEscapesDecodingReader(Reader reader)
Creates an instance of this class.

Method Detail

read

public int read()
         throws IOException
Overrides:
read in class Reader
Throws:
IOException

read

public int read(char[] cbuf,
                int off,
                int len)
         throws IOException
Specified by:
read in class Reader
Throws:
IOException

readInternal

private int readInternal()
                  throws IOException
Implements read() without checking if this reader is closed.

Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in class Reader
Throws:
IOException


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.