protected final JsonToken _finishToken() throws IOException {
  if (_inputPtr >= _inputEnd) {
    return JsonToken.NOT_AVAILABLE;
  }
  byte b=_inputBuffer[_inputPtr++];
  if (_state == STATE_INITIAL) {
    if (b == SmileConstants.HEADER_BYTE_1) {
      if (!_handleHeader(0)) {
        return JsonToken.NOT_AVAILABLE;
      }
      if (_inputPtr >= _inputEnd) {
        return JsonToken.NOT_AVAILABLE;
      }
      b=_inputBuffer[_inputPtr++];
    }
 else {
      if (_cfgRequireHeader) {
        String msg;
        if (b == '{' || b == '[') {
          msg="Input does not start with Smile format header (first byte = 0x" + Integer.toHexString(b & 0xFF) + ") -- rather, it starts with '"+ ((char)b)+ "' (plain JSON input?) -- can not parse";
        }
 else {
          msg="Input does not start with Smile format header (first byte = 0x" + Integer.toHexString(b & 0xFF) + ") and parser has REQUIRE_HEADER enabled: can not parse";
        }
        throw new JsonParseException(this,msg);
      }
    }
  }
 else   if (_state == STATE_HEADER) {
    if (!_handleHeader(_substate)) {
      return JsonToken.NOT_AVAILABLE;
    }
    if (_inputPtr >= _inputEnd) {
      return JsonToken.NOT_AVAILABLE;
    }
    b=_inputBuffer[_inputPtr++];
  }
switch (_state) {
case STATE_NUMBER_INT:
    return _nextInt(_substate,_pendingInt);
case STATE_NUMBER_LONG:
  return _nextLong(_substate,_pendingLong);
case STATE_NUMBER_BIGINT:
return _nextBigInt(_substate);
case STATE_NUMBER_FLOAT:
return _nextFloat(_substate,_pendingInt);
case STATE_NUMBER_DOUBLE:
return _nextDouble(_substate,_pendingLong);
case STATE_NUMBER_BIGDEC:
return _nextBigDecimal(_substate);
}
_throwInvalidState("Illegal state when trying to complete token: ");
return null;
}

protected final JsonToken _finishToken ( ) throws IOException { if ( _inputPtr >= _inputEnd ) { return JsonToken . NOT_AVAILABLE ; } byte b = _inputBuffer [ _inputPtr ++ ] ; if ( _state == STATE_INITIAL ) { if ( b == SmileConstants . HEADER_BYTE_1 ) { if ( ! _handleHeader ( 0 ) ) { return JsonToken . NOT_AVAILABLE ; } if ( _inputPtr >= _inputEnd ) { return JsonToken . NOT_AVAILABLE ; } b = _inputBuffer [ _inputPtr ++ ] ; } else { if ( _cfgRequireHeader ) { String msg ; if ( b == '{' || b == '[' ) { msg = "Input does not start with Smile format header (first byte = 0x" + Integer . toHexString ( b & 0xFF ) + ") -- rather, it starts with '" + ( ( char ) b ) + "' (plain JSON input?) -- can not parse" ; } else { msg = "Input does not start with Smile format header (first byte = 0x" + Integer . toHexString ( b & 0xFF ) + ") and parser has REQUIRE_HEADER enabled: can not parse" ; } throw new JsonParseException ( this , msg ) ; } } } else if ( _state == STATE_HEADER ) { if ( ! _handleHeader ( _substate ) ) { return JsonToken . NOT_AVAILABLE ; } if ( _inputPtr >= _inputEnd ) { return JsonToken . NOT_AVAILABLE ; } b = _inputBuffer [ _inputPtr ++ ] ; } switch ( _state ) { case STATE_NUMBER_INT : return _nextInt ( _substate , _pendingInt ) ; case STATE_NUMBER_LONG : return _nextLong ( _substate , _pendingLong ) ; case STATE_NUMBER_BIGINT : return _nextBigInt ( _substate ) ; case STATE_NUMBER_FLOAT : return _nextFloat ( _substate , _pendingInt ) ; case STATE_NUMBER_DOUBLE : return _nextDouble ( _substate , _pendingLong ) ; case STATE_NUMBER_BIGDEC : return _nextBigDecimal ( _substate ) ; } _throwInvalidState ( "Illegal state when trying to complete token: " ) ; return null ; }
method called to finish parsing of a token , given partial decoded state .
