caravan-protobuf/src/main/java/com/ctrip/soa/caravan/protobuf/v2/customization/CustomProtobufParser.java
/**
   * Method called to finish parsing of a token so that token contents
   * are retriable
   */
Method called to finish parsing of a token so that token contents
are retriable
Method called to finish parsing of a token so that token contents are retriable
@Override
protected void _finishToken() throws IOException
  {
    _tokenIncomplete = false;
    if (_currToken == JsonToken.VALUE_STRING) {
      final int len = _decodedLength;
      if (len > _inputEnd - _inputPtr) {
        if (len >= _inputBuffer.length) {
          _finishLongText(len);
          return;
        }
        _loadToHaveAtLeastCtrip(len);
      }
      _finishShortText(len);
      return;
    }
    if (_currToken == JsonToken.VALUE_EMBEDDED_OBJECT) {
      _binaryValue = _finishBytes(_decodedLength);
      return;
    }
    _throwInternal();
  }
@ Override protected void _finishToken ( ) throws IOException { _tokenIncomplete = false ; if ( _currToken == JsonToken . VALUE_STRING ) { final int len = _decodedLength ; if ( len > _inputEnd - _inputPtr ) { if ( len >= _inputBuffer . length ) { _finishLongText ( len ) ; return ; } _loadToHaveAtLeastCtrip ( len ) ; } _finishShortText ( len ) ; return ; } if ( _currToken == JsonToken . VALUE_EMBEDDED_OBJECT ) { _binaryValue = _finishBytes ( _decodedLength ) ; return ; } _throwInternal ( ) ; }
Method called to finish parsing of a token so that token contents
 are retriable
Method called to finish parsing of a token so that token contents are retriable
// or if not, could we read? // If not enough space, need different handling // offline for better optimization // should never happen but: