Class PeekReader

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

    public final class PeekReader
    extends java.io.Reader
    Parsing-centric reader. This class is not thread safe.
    See Also:
    PeekInputStream
    • Method Detail

      • make

        public static PeekReader make​(java.io.Reader r)
      • make

        public static PeekReader make​(java.io.Reader r,
                                      int bufferSize)
      • makeUTF8

        public static PeekReader makeUTF8​(java.io.InputStream in)
        Make PeekReader where the input is UTF8 : BOM is removed
      • makeASCII

        public static PeekReader makeASCII​(java.io.InputStream in)
        Make PeekReader where the input is ASCII
      • readString

        public static PeekReader readString​(java.lang.String string)
      • open

        public static PeekReader open​(java.lang.String filename)
      • getLineNum

        public long getLineNum()
      • getColNum

        public long getColNum()
      • getPosition

        public long getPosition()
      • peekChar

        public final int peekChar()
      • readChar

        public final int readChar()
      • pushbackChar

        public final void pushbackChar​(int ch)
        push back a character : does not alter underlying position, line or column counts
      • close

        public final void close()
                         throws java.io.IOException
        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
      • read

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

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

        public final boolean eof()