LiangliangSui commented on code in PR #1479:
URL: https://github.com/apache/incubator-fury/pull/1479#discussion_r1555544594


##########
java/fury-core/src/main/java/org/apache/fury/serializer/Serializers.java:
##########
@@ -364,14 +364,13 @@ public BigIntegerSerializer(Fury fury) {
     @Override
     public void write(MemoryBuffer buffer, BigInteger value) {
       final byte[] bytes = value.toByteArray();
-      Preconditions.checkArgument(bytes.length <= 16);
-      buffer.writeByte((byte) bytes.length);
+      buffer.writePositiveVarInt((byte) bytes.length);

Review Comment:
   Directly pass in `bytes.length` to `writePositiveVarInt`. Why do we need to 
convert it to byte? Truncation occurs when `bytes.length > 127`.



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