public char parseEscapeChar(IndexedBufferedReader buffer)
    throws Exception
  {
    // escape char must start with \
    // if it's " or \ or /, return the char
    // if it's 'u', make a new unicode hex-based char
    // if the end of the buffer is reached before resolving, throw exception
    // if the char is not a valid escape char, throw exception
    int c = buffer.read();
    if (c != '\\')
      {
        throw new Exception(jsonError("JSON STRING ERROR",
                                      "escape characters must start with \\",
                                      buffer));
      } // if
    else
      {
        c = buffer.read();
        if (c == '"' || c == '\\' || c == '/')
          {
            // basic escape chars, return value
            return (char) c;
          } // if
        else if (c == 'u')
          {
            //get the four hex numbers
            String unicode = "";
            for (int i = 0; i < 4; i++)
              {
                char num = (char) buffer.read();
                if (Character.isDigit(num) || Character.isAlphabetic(num))
                  {
                    // valid unicode
                    unicode += num;
                  } // if
                else
                  {
                    // invalid
                    throw new Exception(
                                        jsonError("JSON STRING ERROR",
                                                  "invalid unicode char \\u"
                                                      + unicode
                                                      + num
                                                      + ", "
                                                      + num
                                                      + " is not a valid hex-number input",
                                                  buffer));
                  } // else
              } // for
            return (char) Integer.parseInt(unicode, 16);
          } // else if u
        else if (c == -1)
          {
            throw new Exception(
                                jsonError("JSON STRING ERROR",
                                          "unfinished escape character, no closing \" before end of input",
                                          buffer));
          } // else if -1
        else
          {
            throw new Exception(jsonError("JSON STRING ERROR",
                                          "invalid escape character \\"
                                              + (char) c, buffer, -1));
          } // else
      } // else
  } // parseEscapeChar(IndexedBufferedReader)