如何反序列化 Io 中的对象?
我在 Object 上找到了 serialized 和 justSerialized 方法,并且已经成功地将对象序列化到文件,但我找不到匹配的 deserialize 方法。
是没有还是我太笨没找到?
I've found the serialized and justSerialized methods on Object and already successfully serialized objects to files, but I cannot find a matching deserialize method.
Is there none or am I just too stupid to find it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为
doString
或 < code>doMessage
应该做你需要的事情(尽管我现在无法确认这一点,因为我没有在这台机器上运行 Io)。例如:
或
更新 - 现在可以确认
doString
或doMessage
确实有效。完整示例如下:Foo.io
serialize.io
Restore_object.io
事实上,您还可以使用
doRelativeFile
或doFile
:因为序列化后的数据只是Io代码。
/I3az/
I think
doString
ordoMessage
should do what you need (though I can't confirm this at moment because I don't have Io running on this machine).For eg:
or
Update - Can now confirm that
doString
ordoMessage
does work. Full example below:Foo.io
serialize.io
restore_object.io
In fact you can also deserialize the object with
doRelativeFile
ordoFile
:Because serialized data is just Io code.
/I3az/