caravan-protobuf/src/main/java/com/ctrip/soa/caravan/protobuf/v2/customization/CustomProtobufParser.java
/*
    /**********************************************************
    /* Low-level reading: buffer reload
    /**********************************************************
     */
Low-level reading: buffer reload
Low - level reading : buffer reload
protected final boolean loadMoreCtrip() throws IOException
  {
    if (_inputStream != null) {
      _currInputProcessed += _inputEnd;
      int count = _inputStream.read(_inputBuffer, 0, _inputBuffer.length);
      if (count > 0) {
        _currentEndOffset = _parsingContext.adjustEnd(_inputEnd);
        _inputPtr = 0;
        _inputEnd = count;
        return true;
      }
      _closeInput();
      if (count == 0) {
        throw new IOException("InputStream.read() returned 0 characters when trying to read "+_inputBuffer.length+" bytes");
      }
    }
    return false;
  }
protected final boolean loadMoreCtrip ( ) throws IOException { if ( _inputStream != null ) { _currInputProcessed += _inputEnd ; int count = _inputStream . read ( _inputBuffer , 0 , _inputBuffer . length ) ; if ( count > 0 ) { _currentEndOffset = _parsingContext . adjustEnd ( _inputEnd ) ; _inputPtr = 0 ; _inputEnd = count ; return true ; } _closeInput ( ) ; if ( count == 0 ) { throw new IOException ( "InputStream.read() returned 0 characters when trying to read " + _inputBuffer . length + " bytes" ) ; } } return false ; }
Low-level reading: buffer reload
Low - level reading : buffer reload
// End of input // Should never return 0, so let's fail