| java.io.LineNumberReader org.geotools.image.io.text.LineReader
LineReader | final class LineReader extends LineNumberReader (Code) | | A buffered character-input stream that keeps track of line numbers
and stream position. This class can't be public for now, because I
can't figure out how to implement reliably
LineReader.readLine .
version: $Id: LineReader.java 25699 2007-05-31 15:55:07Z desruisseaux $ author: Martin Desruisseaux |
Constructor Summary | |
public | LineReader(Reader in) Create a new line reader, using the default input-buffer size. | public | LineReader(Reader in, int size) Create a new line reader, reading characters
into a buffer of the given size. |
Method Summary | |
public long | getPosition() Get the current stream position. | public void | mark(int readAheadLimit) Mark the present position in the stream. | public int | read() Read a single character. | public int | read(char cbuf, int off, int len) Read characters into a portion of an array. | public String | readLine() Read a line of text. | public void | reset() Reset the stream to the most recent mark. |
LineReader | public LineReader(Reader in)(Code) | | Create a new line reader, using the default input-buffer size.
Parameters: in - a Reader object to provide the underlying stream. |
LineReader | public LineReader(Reader in, int size)(Code) | | Create a new line reader, reading characters
into a buffer of the given size.
Parameters: in - a Reader object to provide the underlying stream. Parameters: size - an int specifying the size of the buffer. |
getPosition | public long getPosition()(Code) | | Get the current stream position.
The current stream position. |
mark | public void mark(int readAheadLimit) throws IOException(Code) | | Mark the present position in the stream. Subsequent calls to
LineReader.reset will attempt to reposition the stream to this point, and will also reset
the stream position appropriately.
Parameters: readAheadLimit - Limit on the number of characters that may be read while stillpreserving the mark. After reading this many characters, attempting to resetthe stream may fail. throws: IOException - If an I/O error occurs. |
read | public int read() throws IOException(Code) | | Read a single character.
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 cbuf, int off, int len) throws IOException(Code) | | Read characters into a portion of an array.
Parameters: cbuf - Destination buffer Parameters: off - Offset at which to start storing characters Parameters: len - Maximum number of characters to read The number of bytes read, or -1 if the end of the stream has already been reached. throws: IOException - If an I/O error occurs. |
readLine | public String readLine() throws IOException(Code) | | 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.
A String containing the contents of the line, not includingany line-termination characters, or null if the end of thestream has been reached throws: IOException - If an I/O error occurs. |
reset | public void reset() throws IOException(Code) | | Reset the stream to the most recent mark.
throws: IOException - If the stream has not been marked, or if the mark has been invalidated. |
|
|