Class StreamNormalizingReader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Readable
    Direct Known Subclasses:
    XMLStreamNormalizingReader

    public class StreamNormalizingReader
    extends NormalizingReader
    This class represents a NormalizingReader which handles streams of bytes.
    • Field Detail

      • charDecoder

        protected CharDecoder charDecoder
        The char decoder.
      • nextChar

        protected int nextChar
        The next char.
      • line

        protected int line
        The current line in the stream.
      • column

        protected int column
        The current column in the stream.
      • charDecoderFactories

        protected static final java.util.Map charDecoderFactories
        The CharDecoder factories map.
    • Constructor Detail

      • StreamNormalizingReader

        public StreamNormalizingReader​(java.io.InputStream is)
                                throws java.io.IOException
        Creates a new NormalizingReader. The encoding is assumed to be ISO-8859-1.
        Parameters:
        is - The input stream to decode.
        Throws:
        java.io.IOException
      • StreamNormalizingReader

        public StreamNormalizingReader​(java.io.InputStream is,
                                       java.lang.String enc)
                                throws java.io.IOException
        Creates a new NormalizingReader.
        Parameters:
        is - The input stream to decode.
        enc - The standard encoding name. A null encoding means ISO-8859-1.
        Throws:
        java.io.IOException
      • StreamNormalizingReader

        public StreamNormalizingReader​(java.io.Reader r)
                                throws java.io.IOException
        Creates a new NormalizingReader.
        Parameters:
        r - The reader to wrap.
        Throws:
        java.io.IOException
      • StreamNormalizingReader

        protected StreamNormalizingReader()
        This constructor is intended for use by subclasses.
    • Method Detail

      • read

        public int read()
                 throws java.io.IOException
        Read a single character. This method will block until a character is available, an I/O error occurs, or the end of the stream is reached.
        Overrides:
        read in class java.io.Reader
        Throws:
        java.io.IOException
      • getLine

        public int getLine()
        Returns the current line in the stream.
        Specified by:
        getLine in class NormalizingReader
      • getColumn

        public int getColumn()
        Returns the current column in the stream.
        Specified by:
        getColumn in class NormalizingReader
      • close

        public void close()
                   throws java.io.IOException
        Close the stream.
        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
      • createCharDecoder

        protected CharDecoder createCharDecoder​(java.io.InputStream is,
                                                java.lang.String enc)
                                         throws java.io.IOException
        Creates the CharDecoder mapped with the given encoding name.
        Throws:
        java.io.IOException