abandy commented on code in PR #45029:
URL: https://github.com/apache/arrow/pull/45029#discussion_r2072409575


##########
swift/Arrow/Sources/Arrow/ArrowReader.swift:
##########
@@ -216,7 +216,67 @@ public class ArrowReader { // swiftlint:disable:this 
type_body_length
         return .success(RecordBatch(arrowSchema, columns: columns))
     }
 
-    public func fromStream( // swiftlint:disable:this function_body_length
+    public func fromMemoryStream( // swiftlint:disable:this 
function_body_length
+        _ fileData: Data,
+        useUnalignedBuffers: Bool = false
+    ) -> Result<ArrowReaderResult, ArrowError> {
+        let result = ArrowReaderResult()
+        var offset: Int = 0
+        var length = getUInt32(fileData, offset: offset)
+        var streamData = fileData
+        var schemaMessage: org_apache_arrow_flatbuf_Schema?
+        while length != 0 {
+            if length == CONTINUATIONMARKER {
+                offset += Int(MemoryLayout<Int32>.size)

Review Comment:
   I will change offset += Int(MemoryLayout<Int32>.size) to offset += 
Int(MemoryLayout<UInt32>.size).  The variable offset is an Int due to the 
parameter type in the call to the buffers loadUnaligned.



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