chaokunyang commented on issue #1980:
URL: https://github.com/apache/fury/issues/1980#issuecomment-2569055185
> Hi @Nikhil-n17 , why do you want to register some classes? Is that for
security consideration? Or you want to skip write classname for smaller
serialized data?
>
> It's hard to ignore class id in the serialized data. You must use
registration all the time, or just don't use it. The registered classes must
have same order and same class id.
>
> One of the solution I think of is that you use multiple Fury instance with
different configuration. And you write a different magic number for every Fury
instance. And use the coresponding Fury for deserialization.
>
> Here is an example:
>
> ```java
> Fury fury1 = Fury.builder().withName("fury1").build();
> MemoryBuffer buffer = xxx;
> buffer.write_int32(magicNumber1);
> fury1.serialize(buffer, new SomeObject());
>
> Fury fury2 = Fury.builder().withName("fury2").build();
> MemoryBuffer buffer2 = xxx;
> buffer2.write_int32(magicNumber1);
> fury2.serialize(buffer2, new SomeObject());
>
> int magicNumber = buffer.read_int32();
> if (magicNumber == magicNumber1) {
> fury1.deserialize(buffer)
> } else if (magicNumber == magicNumber2) {
> fury2.deserialize(buffer)
> }
> ```
I think this already can resolve your issue, is there anything that I miss?
--
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]