szaszm commented on a change in pull request #786:
URL: https://github.com/apache/nifi-minifi-cpp/pull/786#discussion_r426653075



##########
File path: libminifi/include/io/CRCStream.h
##########
@@ -145,17 +145,15 @@ class CRCStream : public BaseStream {
  protected:
 
   /**
-   * Creates a vector and returns the vector using the provided
-   * type name.
+   * Populates the vector using the provided type name.
+   * @param buf output buffer
    * @param t incoming object
-   * @returns vector.
+   * @returns number of bytes read.
    */
   template<typename K>
-  std::vector<uint8_t> readBuffer(const K& t) {
-    std::vector<uint8_t> buf;
+  int readBuffer(std::vector<uint8_t>& buf, const K& t) {

Review comment:
       This leaves the option of a new overload with proper error handling. If 
existing 3rd party extensions happened to use the old overload, it should work 
similarly, even is without error checking.
   
   If you have a better idea, feel free to propose it. I have a few more as 
well, but they also highly deviate from the style of the codebase with limited 
benefit.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to