Updated JSONParser to read from a stream
This commit is contained in:
parent
22adf3b7f2
commit
1a7f0fd1d9
3 changed files with 102 additions and 84 deletions
|
|
@ -61,9 +61,12 @@ public class StringInputStream extends InputStream{
|
|||
* Reads the next byte of data from the input stream.
|
||||
*/
|
||||
public int read(){
|
||||
int ret = Character.getNumericValue( buffer.charAt( 0 ));
|
||||
buffer.deleteCharAt( 0 );
|
||||
return ret;
|
||||
if(buffer.length() > 0){
|
||||
int ret = Character.getNumericValue( buffer.charAt( 0 ));
|
||||
buffer.deleteCharAt( 0 );
|
||||
return ret;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue