bkietz commented on code in PR #571:
URL: https://github.com/apache/arrow-nanoarrow/pull/571#discussion_r1707778173


##########
src/nanoarrow/nanoarrow_ipc.h:
##########
@@ -491,8 +501,59 @@ ArrowErrorCode ArrowIpcOutputStreamInitBuffer(struct 
ArrowIpcOutputStream* strea
 /// close_on_release and handle closing the file independently from stream.
 ArrowErrorCode ArrowIpcOutputStreamInitFile(struct ArrowIpcOutputStream* 
stream,
                                             void* file_ptr, int 
close_on_release);
-/// @}
 
+/// \brief Write to a stream, trying again until all are written or the stream 
errors.
+ArrowErrorCode ArrowIpcOutputStreamWrite(struct ArrowIpcOutputStream* stream,
+                                         struct ArrowBufferView data,
+                                         struct ArrowError* error);
+
+/// \brief A stream writer which encodes Schemas and ArrowArrays into an IPC 
byte stream
+///
+/// This structure is intended to be allocated by the caller,
+/// initialized using ArrowIpcWriterInit(), and released with
+/// ArrowIpcWriterReset().
+struct ArrowIpcWriter {
+  /// \brief Private resources managed by this library
+  void* private_data;
+};
+
+/// \brief Initialize an output stream of bytes from an ArrowArrayStream
+///
+/// Returns NANOARROW_OK on success. If NANOARROW_OK is returned the writer
+/// takes ownership of the output byte stream and the encoder, and the caller 
is
+/// responsible for releasing the writer by calling ArrowIpcWriterReset().
+ArrowErrorCode ArrowIpcWriterInit(struct ArrowIpcWriter* writer,
+                                  struct ArrowIpcEncoder* encoder,

Review Comment:
   I was thinking that the keeping the encoder's initialization separate allows 
us to avoid duplicating options for encoder. However we can probably just give 
configuration access to the stream's internal encoder when that becomes 
necessary.



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to