com.plumtree.openfoundation.io
Class XPBufferedReader

java.lang.Object
  extended bycom.plumtree.openfoundation.io.XPReader
      extended bycom.plumtree.openfoundation.io.XPBufferedReader

public class XPBufferedReader
extends XPReader

Corresponds to java.io.BufferedReader or System.IO.StreamReader.


Field Summary
 
Fields inherited from class com.plumtree.openfoundation.io.XPReader
reader
 
Constructor Summary
XPBufferedReader(java.io.BufferedReader reader)
          Creates a new XPBufferedReader object that wraps the BufferedReader.
XPBufferedReader(java.io.Reader reader)
          Creates a new XPBufferedReader object that wraps the Reader.
XPBufferedReader(XPInputStreamReader reader)
          Creates a new XPBufferedReader object that wraps the InputStreamReader wrapped in the XPInputStreamReader.
 
Method Summary
 void Close()
          Close the stream.
 char Read()
          Read a single character.
 int Read(char[] buffer, int index, int count)
          Read characters into a portion of an array.
 java.lang.String ReadLine()
          Read a line of text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPBufferedReader

public XPBufferedReader(java.io.Reader reader)
Creates a new XPBufferedReader object that wraps the Reader.

Parameters:
reader - An instance of Reader

XPBufferedReader

public XPBufferedReader(java.io.BufferedReader reader)
Creates a new XPBufferedReader object that wraps the BufferedReader.

Parameters:
reader - An instance of BufferedReader

XPBufferedReader

public XPBufferedReader(XPInputStreamReader reader)
Creates a new XPBufferedReader object that wraps the InputStreamReader wrapped in the XPInputStreamReader.

Parameters:
reader - An instance of XPInputStreamReader
Method Detail

Close

public void Close()
Close the stream.


Read

public char Read()
Read a single character.

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(char[] buffer,
                int index,
                int count)
Read characters into a portion of an array.

Parameters:
buffer - Destination buffer
index - Index of buffer at which to begin writing.
count - Maximum number of characters to read
Returns:
The number of characters read, or -1 if the end of the stream has been reached

ReadLine

public java.lang.String ReadLine()
Read a line of text. A line is considered to be terminated by any one of a line feed ('\n'), a carriage return ('\r'), or a carriage return followed immediately by a linefeed.

Returns:
A String containing the contents of the line, not including any line-termination characters, or null if the end of the stream has been reached


Copyright 2002, 2003, 2004 Plumtree Software Inc. All Rights Reserved.