Package ws.schild.jave.utils
Class RBufferedReader
java.lang.Object
java.io.Reader
java.io.BufferedReader
ws.schild.jave.utils.RBufferedReader
- All Implemented Interfaces:
Closeable,AutoCloseable,Readable
A package-private utility extending java.io.BufferedReader. If a line read with
readLine() 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.- Author:
- Carlo Pelliccia
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionreadLine()It returns the next line in the stream.voidreinsertLine(String line) Reinserts a line in the stream.Methods inherited from class java.io.BufferedReader
close, lines, mark, markSupported, read, read, ready, reset, skipMethods inherited from class java.io.Reader
nullReader, read, read, transferTo
-
Constructor Details
-
RBufferedReader
It builds the reader.- Parameters:
in- The underlying reader.
-
-
Method Details
-
readLine
It returns the next line in the stream.- Overrides:
readLinein classBufferedReader- Throws:
IOException- on IO errors
-
reinsertLine
Reinserts a line in the stream. The line will be returned at the nextreadLine()call.- Parameters:
line- The line.
-