ayush00git commented on code in PR #3374:
URL: https://github.com/apache/fory/pull/3374#discussion_r2877119264


##########
go/fory/fory.go:
##########
@@ -495,6 +496,105 @@ func (f *Fory) Deserialize(data []byte, v any) error {
        return nil
 }
 
+// StreamReader supports robust sequential deserialization from a stream.
+// It maintains the ByteBuffer and ReadContext state across multiple 
Deserialize calls,
+// preventing data loss from prefetched buffers and preserving TypeResolver 
metadata
+// (Meta Sharing) across object boundaries.
+type StreamReader struct {
+       fory   *Fory
+       reader io.Reader
+       buffer *ByteBuffer
+}
+
+// NewStreamReader creates a new StreamReader that reads from the provided 
io.Reader.
+// The StreamReader owns the buffer and maintains state across sequential 
Deserialize calls.
+func (f *Fory) NewStreamReader(r io.Reader) *StreamReader {

Review Comment:
   yaa in c++ the streamreader acted as a standalone type which had nothing to 
do with deserialization it just know to fetch bytes when needed, let me 
implement the same for go
   



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to