Class TracedBufferedReader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Readable

    public class TracedBufferedReader
    extends java.io.Reader
    Copied from BufferedReader, trace the read position by modifying the fill() method.
    • Field Summary

      • Fields inherited from class java.io.Reader

        lock
    • Constructor Summary

      Constructors 
      Constructor Description
      TracedBufferedReader​(java.io.Reader in)
      Creates a buffering character-input stream that uses a default-sized input buffer.
      TracedBufferedReader​(java.io.Reader in, int sz)
      Creates a buffering character-input stream that uses an input buffer of the specified size.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      BufferedReader.close()
      java.util.stream.Stream<java.lang.String> lines()
      BufferedReader.lines()
      void mark​(int readAheadLimit)
      BufferedReader.mark(int)
      boolean markSupported()
      BufferedReader.markSupported()
      long position()
      Returns this reader's file position.
      int read()
      BufferedReader.read()
      int read​(char[] cbuf, int off, int len)
      BufferedReader.read(char[], int, int)
      java.lang.String readLine()
      BufferedReader.readLine()
      boolean ready()
      BufferedReader.ready()
      void reset()
      BufferedReader.reset()
      long skip​(long n)
      BufferedReader.skip(long)
      • Methods inherited from class java.io.Reader

        nullReader, read, read, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TracedBufferedReader

        public TracedBufferedReader​(java.io.Reader in,
                                    int sz)
        Creates a buffering character-input stream that uses an input buffer of the specified size.
        Parameters:
        in - A Reader
        sz - Input-buffer size
        Throws:
        java.lang.IllegalArgumentException - If sz <= 0
      • TracedBufferedReader

        public TracedBufferedReader​(java.io.Reader in)
        Creates a buffering character-input stream that uses a default-sized input buffer.
        Parameters:
        in - A Reader
    • Method Detail

      • read

        public int read()
                 throws java.io.IOException
        BufferedReader.read()
        Overrides:
        read in class java.io.Reader
        Throws:
        java.io.IOException
      • read

        public int read​(char[] cbuf,
                        int off,
                        int len)
                 throws java.io.IOException
        BufferedReader.read(char[], int, int)
        Specified by:
        read in class java.io.Reader
        Throws:
        java.io.IOException
      • readLine

        public java.lang.String readLine()
                                  throws java.io.IOException
        BufferedReader.readLine()
        Throws:
        java.io.IOException
      • skip

        public long skip​(long n)
                  throws java.io.IOException
        BufferedReader.skip(long)
        Overrides:
        skip in class java.io.Reader
        Throws:
        java.io.IOException
      • ready

        public boolean ready()
                      throws java.io.IOException
        BufferedReader.ready()
        Overrides:
        ready in class java.io.Reader
        Throws:
        java.io.IOException
      • markSupported

        public boolean markSupported()
        BufferedReader.markSupported()
        Overrides:
        markSupported in class java.io.Reader
      • mark

        public void mark​(int readAheadLimit)
                  throws java.io.IOException
        BufferedReader.mark(int)
        Overrides:
        mark in class java.io.Reader
        Throws:
        java.io.IOException
      • reset

        public void reset()
                   throws java.io.IOException
        BufferedReader.reset()
        Overrides:
        reset in class java.io.Reader
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        BufferedReader.close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in class java.io.Reader
        Throws:
        java.io.IOException
      • lines

        public java.util.stream.Stream<java.lang.String> lines()
        BufferedReader.lines()
      • position

        public long position()
        Returns this reader's file position.
        Returns:
        This reader's file position, a non-negative integer counting the number of bytes from the beginning of the file to the current position