szaszm commented on code in PR #2251:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2251#discussion_r3903350724


##########
minifi-api/common/include/minifi-cpp/io/InputStream.h:
##########
@@ -40,11 +45,13 @@ class InputStream : public virtual Stream {
   virtual size_t read(std::span<std::byte> out_buffer) = 0;
 
   /**
-   * Read string from stream. Use isError (Stream.h) to check for errors.
+   * Read length prefixed string from stream. Use isError (Stream.h) to check 
for errors.
    * @param str reference string
+   * @param length_prefix_size The wideness of the length prefix, 16bit or 
32bit
+   * @param max_length The max length of the string, to avoid excessive 
allocations
    * @return resulting read size or STREAM_ERROR on error or 
static_cast<size_t>(-2) on EAGAIN
    **/
-  size_t read(std::string &str, bool widen = false);
+  size_t read(std::string &str, LengthPrefixSize length_prefix_size, size_t 
max_length);

Review Comment:
   We don't consider this public stable API, only minifi-api.h is.



-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to