Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libserialize.c中serializer_file_init方法 #79

Open
dreamking60 opened this issue Sep 2, 2022 · 1 comment
Open

libserialize.c中serializer_file_init方法 #79

dreamking60 opened this issue Sep 2, 2022 · 1 comment

Comments

@dreamking60
Copy link

serializer_file_init方法,给data的初始化为fopen(path, "rb"),创建的是以二进制格式打开某个文件,我想请问为什么这样子设计,libserialize.c文件给float和double都设计了大端小端的write函数,但是在init方法中data却是一个read形式的东西,不是很理解这种矛盾。

@gozfree
Copy link
Owner

gozfree commented Sep 12, 2022

serializer_file_init设置的是读写系统调用函数,并不能决定数据的排布,在这之上提供一系列大小端write仅数据字节重排,read一般只需要读入raw数据即可

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants