net.sf.saxon.dotnet
Class DotNetReader

java.lang.Object
  extended by java.io.Reader
      extended by net.sf.saxon.dotnet.DotNetReader
All Implemented Interfaces:
java.io.Closeable, java.lang.Readable

public class DotNetReader
extends java.io.Reader

An implementation of java.io.Reader that wraps a .NET System.IO.TextReader


Field Summary
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
DotNetReader(TextReader reader)
          Create a Java Reader that wraps a .NET Reader
 
Method Summary
 void close()
          Close the stream.
 TextReader getUnderlyingTextReader()
          Get the underlying TextReader object
 int read()
          Read a single character.
 int read(char[] cbuf, int off, int len)
          Read characters into a portion of an array.
 
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
 

Constructor Detail

DotNetReader

public DotNetReader(TextReader reader)
Create a Java Reader that wraps a .NET Reader

Parameters:
reader - the .NET Reader
Method Detail

getUnderlyingTextReader

public TextReader getUnderlyingTextReader()
Get the underlying TextReader object

Returns:
the underlying TextReader object

close

public void close()
           throws java.io.IOException
Close the stream. Once a stream has been closed, further read(), ready(), mark(), or reset() invocations will throw an IOException. Closing a previously-closed stream, however, has no effect.

Specified by:
close in interface java.io.Closeable
Specified by:
close in class java.io.Reader
Throws:
java.io.IOException - If an I/O error occurs

read

public int read(char[] cbuf,
                int off,
                int len)
         throws java.io.IOException
Read characters into a portion of an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached.

Specified by:
read in class java.io.Reader
Parameters:
cbuf - Destination buffer
off - Offset at which to start storing 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:
java.io.IOException - If an I/O error occurs

read

public int read()
         throws java.io.IOException
Read a single character. This method will block until a character is available, an I/O error occurs, or the end of the stream is reached.

Subclasses that intend to support efficient single-character input should override this method.

Overrides:
read in class java.io.Reader
Returns:
The character read, as an integer in the range 0 to 65535 (0x00-0xffff), or -1 if the end of the stream has been reached
Throws:
java.io.IOException - If an I/O error occurs