Class RBufferedReader

java.lang.Object
java.io.Reader
java.io.BufferedReader
ws.schild.jave.utils.RBufferedReader
All Implemented Interfaces:
Closeable, AutoCloseable, Readable

public class RBufferedReader extends BufferedReader
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
  • Constructor Details

    • RBufferedReader

      public RBufferedReader(Reader in)
      It builds the reader.
      Parameters:
      in - The underlying reader.
  • Method Details

    • readLine

      public String readLine() throws IOException
      It returns the next line in the stream.
      Overrides:
      readLine in class BufferedReader
      Throws:
      IOException - on IO errors
    • reinsertLine

      public void reinsertLine(String line)
      Reinserts a line in the stream. The line will be returned at the next readLine() call.
      Parameters:
      line - The line.