Code example for Reader

Methods: markSupported

0
     * Construct a JSONTokener from a string. 
     * 
     * @param reader     A reader. 
     */ 
    public JSONTokener(Reader reader) {
        this.reader = reader.markSupported() ? 
        		reader : new BufferedReader(reader);
        this.useLastChar = false;
        this.index = 0;
    } 
 
 
    /** 
     * Construct a JSONTokener from a string. 
     * 
     * @param s     A source string. 
     */ 
    public JSONTokener(String s) {
        this(new StringReader(s));
    }