net.sf.saxon.dotnet

Class DotNetReader


public class DotNetReader
extends java.io.Reader

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

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(cbuf[] , int off, int len)
Read characters into a portion of an array.

Constructor Details

DotNetReader

public DotNetReader(TextReader reader)
Create a Java Reader that wraps a .NET Reader
Parameters:
reader - the .NET Reader

Method Details

close

public void close()
            throws 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.

getUnderlyingTextReader

public TextReader getUnderlyingTextReader()
Get the underlying TextReader object
Returns:
the underlying TextReader object

read

public int read()
            throws 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.

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

read

public int read(cbuf[] ,
                int off,
                int len)
            throws 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.
Parameters:
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