Class CharFilter

    • Field Detail

      • input

        protected final Reader input
        The underlying character-input stream.
    • Constructor Detail

      • CharFilter

        public CharFilter​(Reader input)
        Create a new CharFilter wrapping the provided reader.
        Parameters:
        input - a Reader, can also be a CharFilter for chaining.
    • Method Detail

      • close

        public void close()
                   throws IOException
        Closes the underlying input stream.

        NOTE: The default implementation closes the input Reader, so be sure to call super.close() when overriding this method.

        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in class Reader
        Throws:
        IOException
      • correct

        protected abstract int correct​(int currentOff)
        Subclasses override to correct the current offset.
        Parameters:
        currentOff - current offset
        Returns:
        corrected offset
      • correctOffset

        public final int correctOffset​(int currentOff)
        Chains the corrected offset through the input CharFilter(s).