private char readEscapeCharacter() throws JSONException {
  char escaped=in.charAt(pos++);
switch (escaped) {
case 'u':
    if (pos + 4 > in.length()) {
      throw syntaxError("Unterminated escape sequence");
    }
  String hex=in.substring(pos,pos + 4);
pos+=4;
return (char)Integer.parseInt(hex,16);
case 't':
return '\t';
case 'b':
return '\b';
case 'n':
return '\n';
case 'r':
return '\r';
case 'f':
return '\f';
case '\'':
case '"':
case '\\':
default :
return escaped;
}
}

private char readEscapeCharacter ( ) throws JSONException { char escaped = in . charAt ( pos ++ ) ; switch ( escaped ) { case 'u' : if ( pos + 4 > in . length ( ) ) { throw syntaxError ( "Unterminated escape sequence" ) ; } String hex = in . substring ( pos , pos + 4 ) ; pos += 4 ; return ( char ) Integer . parseInt ( hex , 16 ) ; case 't' : return '\t' ; case 'b' : return '\b' ; case 'n' : return '\n' ; case 'r' : return '\r' ; case 'f' : return '\f' ; case '\'' : case '"' : case '\\' : default : return escaped ; } }
unescapes the character identified by the character or characters that immediately follow a backslash . the backslash ' \ ' should have already been read . this supports both unicode escapes " u000a " and two - character escapes " \ n " .
