Package ws.schild.jave.utils
Class RBufferedReader
- java.lang.Object
-
- java.io.Reader
-
- java.io.BufferedReader
-
- ws.schild.jave.utils.RBufferedReader
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.lang.Readable
public class RBufferedReader extends java.io.BufferedReaderA package-private utility extending java.io.BufferedReader. If a line read withreadLine()is not useful for the calling code, it can be re-inserted in the stream. The same line will be returned again at the next readLine() call.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.ArrayList<java.lang.String>linesRe-inserted lines buffer.
-
Constructor Summary
Constructors Constructor Description RBufferedReader(java.io.Reader in)It builds the reader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringreadLine()It returns the next line in the stream.voidreinsertLine(java.lang.String line)Reinserts a line in the stream.
-
-
-
Method Detail
-
readLine
public java.lang.String readLine() throws java.io.IOExceptionIt returns the next line in the stream.- Overrides:
readLinein classjava.io.BufferedReader- Throws:
java.io.IOException- on IO errors
-
reinsertLine
public void reinsertLine(java.lang.String line)
Reinserts a line in the stream. The line will be returned at the nextreadLine()call.- Parameters:
line- The line.
-
-