Class EncodingPreservingStreamReader


  • public class EncodingPreservingStreamReader
    extends Object
    This stream reader is used to read single and double byte encoded input streams and additionally sets the correct Byte Order.
    • Constructor Detail

      • EncodingPreservingStreamReader

        public EncodingPreservingStreamReader​(com.levigo.jadice.document.io.SeekableInputStream sis,
                                              String encoding,
                                              String needleString)
        This stream reader is used to read single and double byte encoded input streams and additionally sets the correct Byte Order.
        Parameters:
        sis - the stream that shall be read.
        encoding - the encoding that has been determined for this stream.
    • Method Detail

      • read

        public int read()
                 throws IOException
        Reads characters for the stream.
        Returns:
        the read characters or -1 if eof is reached.
        Throws:
        IOException - If an I/O error occurs
      • peek

        public int peek​(int offset)
                 throws IOException
        Peek forward and read the next few characters.
        Parameters:
        offset - offset of the character that shall be read relative to the current reader position.
        Returns:
        the character.
        Throws:
        IOException - If an I/O error occurs
      • consume

        public void consume​(int count)
                     throws IOException
        Consume characters and move the reader position ahead.
        Parameters:
        count - the number of chars that the reader position shall be moved ahead.
        Throws:
        IOException - If an I/O error occurs