Class ScannerInputReader

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

    public class ScannerInputReader
    extends java.io.FilterReader
    implements Constants
    An input stream for java programs. The stream treats either "\n", "\r" or "\r\n" as the end of a line, it always returns \n. It also parses UNICODE characters expressed as ￿. However, if it sees "\\", the second slash cannot begin a unicode sequence. It keeps track of the current position in the input stream. WARNING: The contents of this source file are not part of any supported API. Code that depends on them does so at its own risk: they are subject to change or removal without notice.
    • Field Detail

      • pos

        long pos
      • chpos

        private long chpos
      • pushBack

        private int pushBack
      • buffer

        private final char[] buffer
      • currentIndex

        private int currentIndex
      • numChars

        private int numChars
    • Constructor Detail

      • ScannerInputReader

        public ScannerInputReader​(Environment env,
                                  java.io.InputStream in)
                           throws java.io.UnsupportedEncodingException
        Throws:
        java.io.UnsupportedEncodingException
    • Method Detail

      • getNextChar

        private int getNextChar()
                         throws java.io.IOException
        Get the next character from our buffer. Note: this method has been inlined by hand in the `read' method below. Any changes made to this method should be equally applied to that code.
        Throws:
        java.io.IOException
      • read

        public int read​(char[] buffer,
                        int off,
                        int len)
        Overrides:
        read in class java.io.FilterReader
      • read

        public int read()
                 throws java.io.IOException
        Overrides:
        read in class java.io.FilterReader
        Throws:
        java.io.IOException