|
ImageScience 3.0.0 | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectimagescience.utility.LineReader
public class LineReader
Reads text line-by-line from a character stream using buffering for efficiency. Inspired by java.io.BufferedReader
but with methods providing information about how many characters were actually read during the last call and how many lines were read in total.
Constructor Summary | |
---|---|
LineReader(java.io.Reader reader)
Constructs a buffered line reader from the given character stream reader. |
Method Summary | |
---|---|
long |
chars()
Returns the number of characters read using this reader. |
void |
close()
Closes the character stream reader and releases any system resources associated with it. |
long |
lines()
Returns the number of lines read using this reader. |
java.lang.String |
read()
Reads a line of text. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LineReader(java.io.Reader reader)
reader
- The character stream reader.Method Detail |
---|
public java.lang.String read() throws java.io.IOException
String
containing the contents of the line, not including any line-termination characters, or null
if the end of the stream has been reached.
java.io.IOException
- If an I/O error occurs.public long chars()
public long lines()
public void close() throws java.io.IOException
java.io.IOException
- If an I/O error occurs.
|
ImageScience 3.0.0 | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (C) Erik Meijering. Permission to use this software and corresponding documentation for educational, research, and not-for-profit purposes, without a fee and without a signed licensing agreement, is granted, subject to the following terms and conditions.
IT IS NOT ALLOWED TO REDISTRIBUTE, SELL, OR LEASE THIS SOFTWARE, OR DERIVATIVE WORKS THEREOF, WITHOUT PERMISSION IN WRITING FROM THE COPYRIGHT HOLDER. THE COPYRIGHT HOLDER IS FREE TO MAKE VERSIONS OF THE SOFTWARE AVAILABLE FOR A FEE OR COMMERCIALLY ONLY.
IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OF ANY KIND WHATSOEVER, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE EXPRESS OR IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE AND CORRESPONDING DOCUMENTATION IS PROVIDED "AS IS". THE COPYRIGHT HOLDER HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.