at.dms.util
Class UnicodeReader

java.lang.Object
  extended by java.io.Reader
      extended by java.io.FilterReader
          extended by at.dms.util.UnicodeReader
All Implemented Interfaces:
Closeable, Readable

public class UnicodeReader
extends FilterReader

A character-stream reader that transforms unicode escape sequences into characters according to the Java Language Specification - Second Edition. See JLS 3.2 : Lexical Translations, Step 1 See JLS 3.3 : Unicode Escapes NOTE: we use a lookahead character instead of a pushback reader because for example the sequence "\\u..." would be read as "\" and "\ u . . ."


Field Summary
 
Fields inherited from class java.io.FilterReader
in
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
UnicodeReader(Reader in)
          Creates a new unicode reader.
 
Method Summary
 boolean markSupported()
          Tell whether this stream supports the mark() operation.
 int read()
          Reads a single character.
 int read(char[] buf, int off, int len)
          Reads characters into a portion of an array.
 
Methods inherited from class java.io.FilterReader
close, mark, ready, reset, skip
 
Methods inherited from class java.io.Reader
read, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnicodeReader

public UnicodeReader(Reader in)
Creates a new unicode reader.

Parameters:
in - the reader from which characters will be read
Method Detail

read

public int read()
         throws IOException
Reads a single character.

Overrides:
read in class FilterReader
Returns:
the character read, or -1 if the end of the stream has been reached
Throws:
IOException - if an I/O error occurs

read

public int read(char[] buf,
                int off,
                int len)
         throws IOException
Reads characters into a portion of an array.

Overrides:
read in class FilterReader
Parameters:
buf - destination buffer
off - offset at which to start writing characters
len - maximum number of characters to read
Returns:
the number of characters read, or -1 if the end of the stream has been reached
Throws:
IOException - if an I/O error occurs

markSupported

public boolean markSupported()
Tell whether this stream supports the mark() operation.

Overrides:
markSupported in class FilterReader
Returns:
false: this stream does not support mark()