/** * Get the next character in the source string. * * @return The next character, or 0 if past the end of the source string. * @throws JSONException Thrown if there is an error reading the source string. */ public char next() throws JSONException { int c; if (this.usePrevious) { this.usePrevious = false; c = this.previous; } else { try { c = this.reader.read(); } catch (IOException exception) { throw new JSONException(exception); } } if (c <= 0) { // End of stream this.eof = true; return 0; } this.incrementIndexes(c); this.previous = (char) c; return this.previous; }
/** * Get the next character in the source string. * * @return The next character, or 0 if past the end of the source string. * @throws JSONException Thrown if there is an error reading the source string. */ public char next() throws JSONException { int c; if (this.usePrevious) { this.usePrevious = false; c = this.previous; } else { try { c = this.reader.read(); } catch (IOException exception) { throw new JSONException(exception); } } if (c <= 0) { // End of stream this.eof = true; return 0; } this.incrementIndexes(c); this.previous = (char) c; return this.previous; }
/** * Get the next character in the source string. * * @return The next character, or 0 if past the end of the source string. * @throws JSONException Thrown if there is an error reading the source string. */ public char next() throws JSONException { int c; if (this.usePrevious) { this.usePrevious = false; c = this.previous; } else { try { c = this.reader.read(); } catch (IOException exception) { throw new JSONException(exception); } } if (c <= 0) { // End of stream this.eof = true; return 0; } this.incrementIndexes(c); this.previous = (char) c; return this.previous; }