jeacott1 commented on issue #2273:
URL: https://github.com/apache/fory/issues/2273#issuecomment-3429972138

   I went with a slightly different approach. 
   A simple headerFieldCount as the first header allows me to adjust the number 
of headers over time.
   no need for reserved fields.
   
   ```
      try (ForyInputStream furyIn = new ForyInputStream(in)) {
               // Read header count
               int headerFieldCount = readVarInt32(furyIn);
   
               // Read known headers
               int schemaVersion = readVarInt32(furyIn);
               int foryVersion = readVarInt32(furyIn);
               ...
   
               int remainingHeaders = headerFieldCount - 2 /*known header 
count*/;
               for (int i = 0; i < remainingHeaders; i++) {
                   int unknownField = readVarInt32(furyIn);
                   log.trace("Skipping unknown header field: {}", unknownField);
               }
   
               ThreadSafeFory versionedFory = foryForVersion(foryVersion);
               versionedFory.deserializeJavaObject(furyIn, clazz);
               ...
      }
   ```
   
   


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