chaokunyang commented on code in PR #2218:
URL: https://github.com/apache/fury/pull/2218#discussion_r2084517993
##########
java/fury-core/src/main/java/org/apache/fury/serializer/ArraySerializers.java:
##########
@@ -85,52 +103,69 @@ public void write(MemoryBuffer buffer, T[] arr) {
int len = arr.length;
RefResolver refResolver = fury.getRefResolver();
Serializer componentSerializer = this.componentTypeSerializer;
- int header = componentSerializer != null ? 0b1 : 0b0;
- buffer.writeVarUint32Small7(len << 1 | header);
- if (componentSerializer != null) {
- for (T t : arr) {
- if (!refResolver.writeRefOrNull(buffer, t)) {
- componentSerializer.write(buffer, t);
- }
- }
+ if (this.collectionSerializer != null) {
+ fury.getGenerics().pushGenericType(this.collectionGenericType);
+ ArrayAsList list = new ArrayAsList(0);
+ list.setArray(arr);
+ this.collectionSerializer.write(buffer, list);
Review Comment:
incDepth(-1) should be invoked after serialization
--
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]