chaokunyang commented on code in PR #2130:
URL: https://github.com/apache/fury/pull/2130#discussion_r2021288933


##########
java/fury-core/src/main/java/org/apache/fury/Fury.java:
##########
@@ -586,6 +553,48 @@ public <T> void xwriteRef(MemoryBuffer buffer, T obj, 
Serializer<T> serializer)
     }
   }
 
+  public void xwriteNonRef(MemoryBuffer buffer, Object obj) {
+    ClassInfo classInfo = xtypeResolver.writeClassInfo(buffer, obj);
+    xwriteData(buffer, classInfo, obj);
+  }
+
+  private void xwriteData(MemoryBuffer buffer, ClassInfo classInfo, Object 
obj) {
+    switch (classInfo.getXtypeId()) {
+      case Types.BOOL:
+        buffer.writeBoolean((Boolean) obj);
+        break;
+      case Types.INT8:
+        buffer.writeByte((Byte) obj);
+        break;
+      case Types.INT16:
+        buffer.writeInt16((Short) obj);
+        break;
+      case Types.INT32:
+      case Types.VAR_INT32:
+        // TODO(chaokunyang) support other encoding

Review Comment:
   INT32 and VAR_INT32 are two different algorithms, we do need to suppprt that 
in future. We don't support it in this PR because it will make the PR messy for 
review



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