Skip to content

Commit

Permalink
adds comments
Browse files Browse the repository at this point in the history
  • Loading branch information
John J. Aylward authored and johnjaylward committed Jul 3, 2017
1 parent 5284536 commit 16baa32
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion JSONTokener.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ public static int dehexchar(char c) {
}

/**
* Checks if the end of the input has been reached.
*
* @return true if at the end of the file and we didn't step back
*/
public boolean end() {
Expand All @@ -168,7 +170,8 @@ public boolean more() throws JSONException {
throw new JSONException("Unable to preserve stream position", e);
}
try {
if(this.reader.read()<0) {
// -1 is EOF, but next() can not consume the null character '\0'
if(this.reader.read() <= 0) {
this.eof = true;
return false;
}
Expand Down

0 comments on commit 16baa32

Please sign in to comment.