Class ParseReader

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

    @Deprecated
    public class ParseReader
    extends ProcessingBufferedReader
    Deprecated.
    Class which provides methods for parsing data from a stream.
    Author:
    Garret Wilson
    • Constructor Summary

      Constructors 
      Constructor Description
      ParseReader​(java.io.Reader reader)
      Deprecated.
      Constructor that specifies another reader.
      ParseReader​(java.io.Reader inReader, java.lang.Object sourceObject)
      Deprecated.
       
      ParseReader​(java.io.Reader reader, java.lang.String name)
      Deprecated.
      Constructor that specifies another reader and a name.
      ParseReader​(java.io.Reader inReader, java.lang.StringBuffer prereadCharacters)
      Deprecated.
      Constructor to create a ParseReader from another reader, along with several characters that have already been read.
      ParseReader​(java.io.Reader inReader, java.lang.StringBuffer prereadCharacters, java.lang.Object sourceObject)
      Deprecated.
       
      ParseReader​(java.lang.String inString)
      Deprecated.
      Constructor to create a reader from the contents of a string.
      ParseReader​(java.lang.String inString, java.lang.String name)
      Deprecated.
      Constructor to create a reader from the contents of a string.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      protected void adjustIndexes​(int moveDelta)
      Deprecated.
      Adjusts all indexes by a certain amount.
      long getCharIndex()
      Deprecated.
       
      long getCharIndex​(int bufferIndex)
      Deprecated.
       
      protected int getLastPositionIndex()
      Deprecated.
       
      long getLineIndex()
      Deprecated.
       
      long getLineIndex​(int bufferIndex)
      Deprecated.
       
      java.lang.String getName()
      Deprecated.
      Returns the name of this reader.
      java.lang.Object getSourceObject()
      Deprecated.
       
      protected void initializeIndexes()
      Deprecated.
      Initializes relevant buffer indexes when, for example, the buffer is first created.
      boolean isPeekStringEOF​(java.lang.String string)
      Deprecated.
      Peeks to check if the next characters are the given string, but does not throw an exception if the end of the file is reached.
      protected void moveBuffer​(int sourceIndex, int destIndex, int len)
      Deprecated.
      Moves a portion of the buffer.
      char peekChar()
      Deprecated.
      Peeks at the next character to be read, and throws an exception if there are no more characters to read.
      char peekExpectedChar​(java.lang.String expectedChars)
      Deprecated.
      Makes sure the next character to be read is one we expect, but that character is left to be read.
      int peekExpectedStrings​(java.lang.String[] expectedStrings)
      Deprecated.
      Checks to see if the string of characters waiting to be read matches any that are expected.
      java.lang.String peekString​(int len)
      Deprecated.
      Peeks the specified number of characters, and throws an exception if the end of the file is reached.
      java.lang.String peekStringEOF​(int len)
      Deprecated.
      Peeks the specified number of characters, but does not throw an exception if the end of the file is reached.
      char readChar()
      Deprecated.
      Read a single character, and throws an exception if the end of the file is reached.
      java.lang.String readDelimitedString​(char startDelimiter, char endDelimiter)
      Deprecated.
      Reads text from an input stream that that has certain beginning and ending delimiter characters.
      java.lang.String readDelimitedString​(java.lang.String endDelimiter)
      Deprecated.
      Reads text from an input stream that ends in a certain delimiter.
      java.lang.String readDelimitedString​(java.lang.String startDelimiter, java.lang.String endDelimiter)
      Deprecated.
      Reads text from an input stream that that has certain beginning and ending delimiters.
      java.lang.String readDelimitedStringInclusive​(char startDelimiter, char endDelimiter)
      Deprecated.
      Reads text from an input stream that that has certain beginning and ending delimiter characters, and returns the string including the delimiters.
      java.lang.String readDelimitedStringInclusive​(java.lang.String startDelimiter, java.lang.String endDelimiter)
      Deprecated.
      Reads text from an input stream that that has certain beginning and ending delimiters, and returns the string including the delimiters.
      char readExpectedChar​(char expectedChar)
      Deprecated.
      Gets the next character from the reader, and make sure it's the character we expected; otherwise an exception is thrown.
      char readExpectedChar​(java.lang.String expectedChars)
      Deprecated.
      Gets the next character from the reader, and make sure it's a character we expect; otherwise an exception is thrown.
      java.lang.String readExpectedString​(java.lang.String expectedString)
      Deprecated.
      Gets the a certain number of characters from the reader, and makes sure they are what we expected; otherwise an exception is thrown.
      java.lang.String readExpectedStringIgnoreCase​(java.lang.String expectedString)
      Deprecated.
      Gets the a certain number of characters from the reader, and makes sure they are what we expected, ignoring case; otherwise an exception is thrown.
      int readExpectedStrings​(java.lang.String[] expectedStrings)
      Deprecated.
      Reads a string of characters and makes sure they match a string in a given list, returning the index of the matched string.
      java.lang.String readString​(int len)
      Deprecated.
      Gets the specified number of characters from the reader.
      java.lang.String readStringUntilChar​(char delimiterChar)
      Deprecated.
      Reads characters until a particular character is reached.
      java.lang.String readStringUntilChar​(java.lang.String delimiterCharString)
      Deprecated.
      Reads characters until one of the characters in delimiterCharString is reached.
      java.lang.String readStringUntilCharEOF​(char delimiterChar)
      Deprecated.
      Reads characters until a particular character is reached or the end of the file is reached.
      java.lang.String readStringUntilCharEOF​(java.lang.String delimiterCharString)
      Deprecated.
      Reads characters until one of the characters in delimiterCharString is reached, or the end of the file is reached.
      java.lang.String readStringUntilSkipString​(java.lang.String delimiterString)
      Deprecated.
      Reads characters up to the given string and skips the given string.
      java.lang.String readStringUntilString​(java.lang.String delimiterString)
      Deprecated.
      Reads characters until the given string is reached.
      void setCharIndex​(long newCharIndex)
      Deprecated.
      Changes the index of the last character read.
      protected void setLastPositionIndex​(int lastPositionIndex)
      Deprecated.
      Sets the index of the last time the line and character indexes were updated.
      void setLineIndex​(long newLineIndex)
      Deprecated.
      Changes the line index of the last character read.
      void setName​(java.lang.String newName)
      Deprecated.
      Sets the name of the reader.
      void setSourceObject​(java.lang.Object newSourceObject)
      Deprecated.
      Sets the source of the reader's data.
      long skipChars​(long n)
      Deprecated.
      Skips the specified number of characters, and throws an exception if the end of the file is reached.
      long skipChars​(java.lang.String skipChars)
      Deprecated.
      Skips every character that matches the skip characters, and returns the number of characters skipped.
      long skipCharsEOF​(java.lang.String skipChars)
      Deprecated.
      Skips every character that matches the skip characters, and returns the number of characters skipped.
      protected void updatePosition​(int updateIndex)
      Deprecated.
      Updates the line and character indexes and sets the last position index to one character before the given index, which is usually the read index.
      • Methods inherited from class java.io.Reader

        nullReader, read, read, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ParseReader

        public ParseReader​(java.io.Reader reader)
        Deprecated.
        Constructor that specifies another reader.
        Parameters:
        reader - The reader that contains the data.
      • ParseReader

        public ParseReader​(java.io.Reader reader,
                           java.lang.String name)
        Deprecated.
        Constructor that specifies another reader and a name.
        Parameters:
        reader - The reader that contains the data.
        name - The name of the reader.
      • ParseReader

        public ParseReader​(java.lang.String inString)
                    throws java.io.IOException
        Deprecated.
        Constructor to create a reader from the contents of a string.
        Parameters:
        inString - The string that should be used for input.
        Throws:
        java.io.IOException - Thrown when an I/O error occurs.
      • ParseReader

        public ParseReader​(java.lang.String inString,
                           java.lang.String name)
                    throws java.io.IOException
        Deprecated.
        Constructor to create a reader from the contents of a string.
        Parameters:
        inString - The string that should be used for input.
        name - The name of the reader.
        Throws:
        java.io.IOException - Thrown when an I/O error occurs.
      • ParseReader

        public ParseReader​(java.io.Reader inReader,
                           java.lang.StringBuffer prereadCharacters)
                    throws java.io.IOException
        Deprecated.
        Constructor to create a ParseReader from another reader, along with several characters that have already been read. prereadCharacters must be less than or equal to the length of the buffer.
        Parameters:
        inReader - The reader that contains the data.
        prereadCharacters - The characters that have already been read.
        Throws:
        java.io.IOException - Thrown if prereadCharacters is too long for the buffer.
        See Also:
        ProcessingBufferedReader
      • ParseReader

        public ParseReader​(java.io.Reader inReader,
                           java.lang.Object sourceObject)
                    throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • ParseReader

        public ParseReader​(java.io.Reader inReader,
                           java.lang.StringBuffer prereadCharacters,
                           java.lang.Object sourceObject)
                    throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
    • Method Detail

      • getSourceObject

        public java.lang.Object getSourceObject()
        Deprecated.
        Returns:
        The source of the data, if one has been assigned.
      • setSourceObject

        public void setSourceObject​(java.lang.Object newSourceObject)
        Deprecated.
        Sets the source of the reader's data.
        Parameters:
        newSourceObject - The new source of the reader's data.
      • getName

        public java.lang.String getName()
        Deprecated.
        Returns the name of this reader. If there is no name, and there is a source object, the source object in string form is returned. This function is guaranteed not to return null.
        Returns:
        The name of this reader, if one has been assigned, else the empty string.
        See Also:
        getSourceObject()
      • setName

        public void setName​(java.lang.String newName)
        Deprecated.
        Sets the name of the reader.
        Parameters:
        newName - The new name of the reader.
      • getLineIndex

        public long getLineIndex​(int bufferIndex)
        Deprecated.
        Parameters:
        bufferIndex - The buffer index of specified character.
        Returns:
        The index of the line of the character at the specified index in the buffer.
        See Also:
        getCharIndex(int)
      • getLineIndex

        public long getLineIndex()
        Deprecated.
        Returns:
        The index of the line of the character last read, or 0 if no characters have been read.
        See Also:
        getCharIndex(int)
      • setLineIndex

        public void setLineIndex​(long newLineIndex)
        Deprecated.
        Changes the line index of the last character read.
        Parameters:
        newLineIndex - The new line index.
        See Also:
        setCharIndex(long)
      • getCharIndex

        public long getCharIndex​(int bufferIndex)
        Deprecated.
        Parameters:
        bufferIndex - The buffer index of the specified character.
        Returns:
        The character index of the character at the specified index in the buffer.
        See Also:
        getLineIndex(int)
      • getCharIndex

        public long getCharIndex()
        Deprecated.
        Returns:
        The index of the character last read, or -1 if no characters have been read.
        See Also:
        getLineIndex(int)
      • setCharIndex

        public void setCharIndex​(long newCharIndex)
        Deprecated.
        Changes the index of the last character read.
        Parameters:
        newCharIndex - The new character index.
        See Also:
        setLineIndex(long)
      • setLastPositionIndex

        protected void setLastPositionIndex​(int lastPositionIndex)
        Deprecated.
        Sets the index of the last time the line and character indexes were updated. This is usually set to the current read index after synchronizing the position.
        Parameters:
        lastPositionIndex - The index of the last time the line and character indexes were updated.
        See Also:
        getLineIndex(int), getCharIndex(int), ProcessingBufferedReader.getReadIndex()
      • adjustIndexes

        protected void adjustIndexes​(int moveDelta)
        Deprecated.
        Adjusts all indexes by a certain amount. This method calls the parent version of this method and then updates the last position index.
        Overrides:
        adjustIndexes in class ProcessingBufferedReader
        Parameters:
        moveDelta - The number of characters to move the indexes, positive for forwards, negative for backwards.
        See Also:
        ProcessingBufferedReader.fetchBuffer()
      • moveBuffer

        protected void moveBuffer​(int sourceIndex,
                                  int destIndex,
                                  int len)
        Deprecated.
        Moves a portion of the buffer. This method updates the line and character positions before the data is moved.
        Overrides:
        moveBuffer in class ProcessingBufferedReader
        Parameters:
        sourceIndex - The index in the buffer to be moved.
        destIndex - The destination in the buffer for the data being moved.
        len - The number of characters to move.
        See Also:
        getLineIndex(int), getCharIndex(int), getLastPositionIndex()
      • updatePosition

        protected void updatePosition​(int updateIndex)
        Deprecated.
        Updates the line and character indexes and sets the last position index to one character before the given index, which is usually the read index. This method counts the line breaks between the last position index and the read index -1 and updates the line and character indexes appropriately. This method is called by getLineIndex(), getCharIndex(), and moveBuffer().
        Parameters:
        updateIndex - The index of the character after the position should be updated to.
        See Also:
        getLineIndex(int), getCharIndex(int), getLastPositionIndex(), moveBuffer(int, int, int), ProcessingBufferedReader.getReadIndex()
      • readChar

        public char readChar()
                      throws java.io.IOException,
                             ParseEOFException
        Deprecated.
        Read a single character, and throws an exception if the end of the file is reached.
        Returns:
        The character read.
        Throws:
        java.io.IOException - Thrown if a general I/O error occurs.
        ParseEOFException - Thrown if the end of the file is reached unexpectedly.
        See Also:
        ProcessingBufferedReader.read()
      • peekChar

        public char peekChar()
                      throws java.io.IOException,
                             ParseEOFException
        Deprecated.
        Peeks at the next character to be read, and throws an exception if there are no more characters to read. Each successive peek will return a successive character. This function is reset with every call to read(). Since every peek reads a successive character, resetPeek() should be called if it must be ensured that the next character peeked is the next character to be read. This function really reads a character, but all characters peeked will be unread before characters are read in a call to readCharacter().
        Returns:
        The next character that will be read after the character retrieved in the last read() or peek().
        Throws:
        java.io.IOException - Thrown when a general I/O error occurs.
        ParseEOFException - Thrown if the end of the file is reached unexpectedly.
        See Also:
        ProcessingBufferedReader.read(), readChar(), ProcessingBufferedReader.resetPeek()
      • peekString

        public java.lang.String peekString​(int len)
                                    throws java.io.IOException,
                                           ParseEOFException
        Deprecated.
        Peeks the specified number of characters, and throws an exception if the end of the file is reached. This function is reset with every call to read().
        Parameters:
        len - The number of characters to peek.
        Returns:
        A string containing the characters peeked.
        Throws:
        java.io.IOException - Thrown when a general I/O error occurs.
        ParseEOFException - Thrown if the end of the file is reached unexpectedly.
      • peekStringEOF

        public java.lang.String peekStringEOF​(int len)
                                       throws java.io.IOException
        Deprecated.
        Peeks the specified number of characters, but does not throw an exception if the end of the file is reached. This function is reset with every call to read().
        Parameters:
        len - The number of characters to peek.
        Returns:
        A string containing the characters peeked.
        Throws:
        java.io.IOException - Thrown when a general I/O error occurs.
      • isPeekStringEOF

        public boolean isPeekStringEOF​(java.lang.String string)
                                throws java.io.IOException
        Deprecated.
        Peeks to check if the next characters are the given string, but does not throw an exception if the end of the file is reached. This function is reset with every call to read().
        Parameters:
        string - The string to be verified if it is the next characters on the file.
        Returns:
        true if the upcoming characters match the given string.
        Throws:
        java.io.IOException - Thrown when a general I/O error occurs.
      • peekExpectedChar

        public char peekExpectedChar​(java.lang.String expectedChars)
                              throws java.io.IOException,
                                     ParseUnexpectedDataException,
                                     ParseEOFException
        Deprecated.
        Makes sure the next character to be read is one we expect, but that character is left to be read. This function is reset with every call to read().
        Parameters:
        expectedChars - A string with the list of allowed characters.
        Returns:
        The next character that will be read after the character retrieved in the last read() or peek().
        Throws:
        java.io.IOException - Thrown when an i/o error occurs.
        ParseUnexpectedDataException - Thrown when an unexpected character is found.
        ParseEOFException - Thrown when the end of the input stream is reached unexpectedly.
      • peekExpectedStrings

        public int peekExpectedStrings​(java.lang.String[] expectedStrings)
                                throws java.io.IOException,
                                       ParseUnexpectedDataException,
                                       ParseEOFException
        Deprecated.
        Checks to see if the string of characters waiting to be read matches any that are expected. If several strings match, the index of the first match will be returned. It is not required that peeking be reset before calling this function, but doing so will ensure that any error messages will correctly reflect the beginning search position. TODO perhaps we could fix this Performance will be increased if strings are arranged in the array from shortest to longest. TODO do this automatically, later To have this function not throw an exception of none of the strings are found, pass an empty string as the last argument in expectedStrings.
        Parameters:
        expectedStrings - An array of strings to expect.
        Returns:
        The index of the string which is waiting to be read.
        Throws:
        java.io.IOException - Thrown when an i/o error occurs.
        ParseUnexpectedDataException - Thrown when an unexpected character is found.
        ParseEOFException - Thrown when the end of the input stream is reached unexpectedly.
        See Also:
        peekChar(), readExpectedStrings(java.lang.String[])
      • readExpectedStrings

        public int readExpectedStrings​(java.lang.String[] expectedStrings)
                                throws java.io.IOException,
                                       ParseUnexpectedDataException,
                                       ParseEOFException
        Deprecated.
        Reads a string of characters and makes sure they match a string in a given list, returning the index of the matched string. If several strings match, the index of the first match will be returned. Resets peeking. Performance will be increased if strings are arranged in the array from shortest to longest. TODO do this automatically, later To have this function not throw an exception of none of the strings are found, pass an empty string as the last argument in expectedStrings.
        Parameters:
        expectedStrings - An array of strings to expect.
        Returns:
        The index of the string which is waiting to be read.
        Throws:
        java.io.IOException - Thrown when an i/o error occurs.
        ParseUnexpectedDataException - Thrown when an unexpected character is found.
        ParseEOFException - Thrown when the end of the input stream is reached unexpectedly.
        See Also:
        peekExpectedStrings(java.lang.String[])
      • skipChars

        public long skipChars​(long n)
                       throws java.io.IOException,
                              ParseEOFException
        Deprecated.
        Skips the specified number of characters, and throws an exception if the end of the file is reached. Resets peeking.
        Parameters:
        n - The number of characters to skip.
        Returns:
        The number of characters actually skipped.
        Throws:
        java.io.IOException - Thrown when a general I/O error occurs.
        ParseEOFException - Thrown if the end of the file is reached unexpectedly.
      • skipChars

        public long skipChars​(java.lang.String skipChars)
                       throws java.io.IOException,
                              ParseEOFException
        Deprecated.
        Skips every character that matches the skip characters, and returns the number of characters skipped. Throws an exception if the end of the file is unexpectedly reached. Resets peeking.
        Parameters:
        skipChars - The characters which should be skipped.
        Returns:
        The number of characters skipped.
        Throws:
        java.io.IOException - Thrown when an i/o error occurs.
        ParseEOFException - Thrown if the end of the file is reached unexpectedly.
      • skipCharsEOF

        public long skipCharsEOF​(java.lang.String skipChars)
                          throws java.io.IOException
        Deprecated.
        Skips every character that matches the skip characters, and returns the number of characters skipped. No exception is thrown if the end of the file is reached. Resets peeking.
        Parameters:
        skipChars - The characters which should be skipped.
        Returns:
        The number of characters skipped.
        Throws:
        java.io.IOException - Thrown when an i/o error occurs.
      • readStringUntilChar

        public java.lang.String readStringUntilChar​(char delimiterChar)
                                             throws java.io.IOException,
                                                    ParseEOFException
        Deprecated.
        Reads characters until a particular character is reached. The delimiter character reached will be the next character read.
        Parameters:
        delimiterChar - The character which indicates reading should stop.
        Returns:
        The characters up to but not including the delimiter character reached.
        Throws:
        java.io.IOException - Thrown when an i/o error occurs.
        ParseEOFException - Thrown when the end of the input stream is reached unexpectedly.
      • readStringUntilCharEOF

        public java.lang.String readStringUntilCharEOF​(char delimiterChar)
                                                throws java.io.IOException
        Deprecated.
        Reads characters until a particular character is reached or the end of the file is reached. If a delimiter character was reached, it will be the next character read. No exception is thrown if the end of the file is reached.
        Parameters:
        delimiterChar - The character which indicates reading should stop.
        Returns:
        The characters up to but not including the delimiter character reached or the end of the file.
        Throws:
        java.io.IOException - Thrown when an i/o error occurs.
      • readStringUntilChar

        public java.lang.String readStringUntilChar​(java.lang.String delimiterCharString)
                                             throws java.io.IOException,
                                                    ParseEOFException
        Deprecated.
        Reads characters until one of the characters in delimiterCharString is reached. The delimiter character reached will be the next character read. Resets peeking. Note that this function has a limitation of the largest integer for the number of characters returned.
        Parameters:
        delimiterCharString - A list of characters which indicate reading should stop.
        Returns:
        The characters up to but not including the delimiter character reached.
        Throws:
        java.io.IOException - Thrown when an i/o error occurs.
        ParseEOFException - Thrown when the end of the input stream is reached unexpectedly.
      • readStringUntilString

        public java.lang.String readStringUntilString​(java.lang.String delimiterString)
                                               throws java.io.IOException,
                                                      ParseEOFException
        Deprecated.
        Reads characters until the given string is reached. The first character of the delimiter string reached will be the next character read. Resets peeking. Note that this function has a limitation of the largest integer for the number of characters returned.
        Parameters:
        delimiterString - The string that indicates reading should stop.
        Returns:
        The characters up to but not including the delimiter string reached.
        Throws:
        java.io.IOException - Thrown when an i/o error occurs.
        ParseEOFException - Thrown when the end of the input stream is reached unexpectedly.
      • readStringUntilSkipString

        public java.lang.String readStringUntilSkipString​(java.lang.String delimiterString)
                                                   throws java.io.IOException,
                                                          ParseEOFException
        Deprecated.
        Reads characters up to the given string and skips the given string. Resets peeking. Note that this function has a limitation of the largest integer for the number of characters returned.
        Parameters:
        delimiterString - The string that indicates reading should stop.
        Returns:
        The characters up to but not including the delimiter string reached.
        Throws:
        java.io.IOException - Thrown when an i/o error occurs.
        ParseEOFException - Thrown when the end of the input stream is reached unexpectedly.
      • readStringUntilCharEOF

        public java.lang.String readStringUntilCharEOF​(java.lang.String delimiterCharString)
                                                throws java.io.IOException
        Deprecated.
        Reads characters until one of the characters in delimiterCharString is reached, or the end of the file is reached. If a delimiter character was reached, it will be the next character read. No exception is thrown if the end of the file is reached. Resets peeking. Note that this function has a limitation of the largest integer for the number of characters returned.
        Parameters:
        delimiterCharString - A list of characters which indicate reading should stop.
        Returns:
        The characters up to but not including the delimiter character reached or the end of the file.
        Throws:
        java.io.IOException - Thrown when an i/o error occurs.
      • readExpectedChar

        public char readExpectedChar​(char expectedChar)
                              throws java.io.IOException,
                                     ParseUnexpectedDataException,
                                     ParseEOFException
        Deprecated.
        Gets the next character from the reader, and make sure it's the character we expected; otherwise an exception is thrown.
        Parameters:
        expectedChar - The character expected.
        Returns:
        The character read.
        Throws:
        java.io.IOException - Thrown when an i/o error occurs.
        ParseUnexpectedDataException - Thrown when an unexpected character is found.
        ParseEOFException - Thrown when the end of the input stream is reached unexpectedly.
      • readExpectedChar

        public char readExpectedChar​(java.lang.String expectedChars)
                              throws java.io.IOException,
                                     ParseUnexpectedDataException,
                                     ParseEOFException
        Deprecated.
        Gets the next character from the reader, and make sure it's a character we expect; otherwise an exception is thrown.
        Parameters:
        expectedChars - A string with the list of allowed characters.
        Returns:
        The character read.
        Throws:
        java.io.IOException - Thrown when an i/o error occurs.
        ParseUnexpectedDataException - Thrown when an unexpected character is found.
        ParseEOFException - Thrown when the end of the input stream is reached unexpectedly.
      • readString

        public java.lang.String readString​(int len)
                                    throws java.io.IOException,
                                           ParseEOFException
        Deprecated.
        Gets the specified number of characters from the reader.
        Parameters:
        len - The number of characters to read.
        Returns:
        The characters read.
        Throws:
        java.io.IOException - Thrown when an i/o error occurs.
        ParseEOFException - Thrown if the end of the file is reached unexpectedly.
      • readExpectedString

        public java.lang.String readExpectedString​(java.lang.String expectedString)
                                            throws java.io.IOException,
                                                   ParseUnexpectedDataException,
                                                   ParseEOFException
        Deprecated.
        Gets the a certain number of characters from the reader, and makes sure they are what we expected; otherwise an exception is thrown.
        Parameters:
        expectedString - The characters expected.
        Returns:
        The string read.
        Throws:
        java.io.IOException - Thrown when an i/o error occurs.
        ParseUnexpectedDataException - Thrown when an unexpected character is found.
        ParseEOFException - Thrown when the end of the input stream is reached unexpectedly.
      • readExpectedStringIgnoreCase

        public java.lang.String readExpectedStringIgnoreCase​(java.lang.String expectedString)
                                                      throws java.io.IOException,
                                                             ParseUnexpectedDataException,
                                                             ParseEOFException
        Deprecated.
        Gets the a certain number of characters from the reader, and makes sure they are what we expected, ignoring case; otherwise an exception is thrown.
        Parameters:
        expectedString - The characters expected.
        Returns:
        The string read.
        Throws:
        java.io.IOException - Thrown when an i/o error occurs.
        ParseUnexpectedDataException - Thrown when an unexpected character is found.
        ParseEOFException - Thrown when the end of the input stream is reached unexpectedly.
      • readDelimitedString

        public java.lang.String readDelimitedString​(java.lang.String endDelimiter)
                                             throws java.io.IOException,
                                                    ParseEOFException
        Deprecated.
        Reads text from an input stream that ends in a certain delimiter. The ending delimiter will be discarded.
        Parameters:
        endDelimiter - The string to expect at the end of the characters.
        Returns:
        The characters before the delimiter.
        Throws:
        java.io.IOException - Thrown when an i/o error occurs.
        ParseEOFException - Thrown when the end of the input stream is reached unexpectedly.
      • readDelimitedString

        public java.lang.String readDelimitedString​(java.lang.String startDelimiter,
                                                    java.lang.String endDelimiter)
                                             throws java.io.IOException,
                                                    ParseUnexpectedDataException,
                                                    ParseEOFException
        Deprecated.
        Reads text from an input stream that that has certain beginning and ending delimiters. The ending delimiter will be discarded.
        Parameters:
        startDelimiter - The string to expect at the first of the characters.
        endDelimiter - The string to expect at the end of the characters.
        Returns:
        The characters between the delimiters.
        Throws:
        java.io.IOException - Thrown when an i/o error occurs.
        ParseUnexpectedDataException - Thrown when an unexpected character is found.
        ParseEOFException - Thrown when the end of the input stream is reached unexpectedly.
      • readDelimitedString

        public java.lang.String readDelimitedString​(char startDelimiter,
                                                    char endDelimiter)
                                             throws java.io.IOException,
                                                    ParseUnexpectedDataException,
                                                    ParseEOFException
        Deprecated.
        Reads text from an input stream that that has certain beginning and ending delimiter characters. The ending delimiter will be discarded.
        Parameters:
        startDelimiter - The character to expect at the first of the characters.
        endDelimiter - The character to expect at the end of the characters.
        Returns:
        The characters between the delimiters.
        Throws:
        java.io.IOException - Thrown when an i/o error occurs.
        ParseUnexpectedDataException - Thrown when an unexpected character is found.
        ParseEOFException - Thrown when the end of the input stream is reached unexpectedly.
      • readDelimitedStringInclusive

        public java.lang.String readDelimitedStringInclusive​(char startDelimiter,
                                                             char endDelimiter)
                                                      throws java.io.IOException,
                                                             ParseUnexpectedDataException,
                                                             ParseEOFException
        Deprecated.
        Reads text from an input stream that that has certain beginning and ending delimiter characters, and returns the string including the delimiters.
        Parameters:
        startDelimiter - The character to expect at the first of the characters.
        endDelimiter - The character to expect at the end of the characters.
        Returns:
        The delimiters with the character between them.
        Throws:
        java.io.IOException - Thrown when an i/o error occurs.
        ParseUnexpectedDataException - Thrown when an unexpected character is found.
        ParseEOFException - Thrown when the end of the input stream is reached unexpectedly.
      • readDelimitedStringInclusive

        public java.lang.String readDelimitedStringInclusive​(java.lang.String startDelimiter,
                                                             java.lang.String endDelimiter)
                                                      throws java.io.IOException,
                                                             ParseUnexpectedDataException,
                                                             ParseEOFException
        Deprecated.
        Reads text from an input stream that that has certain beginning and ending delimiters, and returns the string including the delimiters.
        Parameters:
        startDelimiter - The string to expect at the first of the characters.
        endDelimiter - The string to expect at the end of the characters.
        Returns:
        The delimiters with the character between them.
        Throws:
        java.io.IOException - Thrown when an i/o error occurs.
        ParseUnexpectedDataException - Thrown when an unexpected character is found.
        ParseEOFException - Thrown when the end of the input stream is reached unexpectedly.