Class LineEndingProcessingProvider

  • All Implemented Interfaces:
    Provider

    public class LineEndingProcessingProvider
    extends java.lang.Object
    implements Provider
    Provider un-escaping unicode escape sequences in the input sequence.
    • Field Detail

      • _input

        private final Provider _input
        The "other" provider which we are wrapping around / reading from.
      • _data

        private final char[] _data
        The buffer that we're storing data within.
      • _len

        private int _len
        The number of characters in _data.
      • _pos

        private int _pos
        The position in _data where to read the next source character from.
      • eolCounts

        private final java.util.Map<LineSeparator,​java.lang.Integer> eolCounts
    • Constructor Detail

      • LineEndingProcessingProvider

        public LineEndingProcessingProvider​(Provider input)
      • LineEndingProcessingProvider

        public LineEndingProcessingProvider​(int bufferSize,
                                            Provider input)
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Description copied from interface: Provider
        Closes the stream and releases any system resources associated with it.
        Specified by:
        close in interface Provider
        Throws:
        java.io.IOException
      • fillBuffer

        private int fillBuffer()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • getDetectedLineEnding

        public LineSeparator getDetectedLineEnding()
      • isBufferEmpty

        private boolean isBufferEmpty()
      • nextBufferedChar

        private int nextBufferedChar()
                              throws java.io.IOException
        Retrieves the next un-escaped character from the buffered _input.
        Returns:
        The next character or -1 if no more input is available.
        Throws:
        java.io.IOException
      • read

        public int read​(char[] buffer,
                        int offset,
                        int len)
                 throws java.io.IOException
        Description copied from interface: Provider
        Reads characters into an array
        Specified by:
        read in interface Provider
        Parameters:
        buffer - Destination buffer
        offset - Offset at which to start storing characters
        len - The maximum possible number of characters to read
        Returns:
        The number of characters read, or -1 if all read
        Throws:
        java.io.IOException