Problems with ByteArray.writeObject()

http://www.actionscript.org/forums/showthread.php3?t=215339
1. Not every object may be serialized at all.(不是所有的对象都可以序列化)
2. Those that may be serialized require that you:(满足如下条件即可)
a. register their class for serialization by using registerClassAlias or, in Flex you can use [RemoteClass] meta, which basically does the same thing.
(要求对类通过registerClassAlias 来注册为可序列化,或者通过标签[RemoteClass]来注册,他们两个就一个德行
b. if they happen to have constructor arguments, they need defaults for them.
(如果类的构造函数有参数要求,该参数一定要设定默认值)
c. alternatively, they should implement IExternalizable.
(或者实现IExternalizable接口)

However, all prime types are serializable (they don't need to implement IExternalizable).(所有的基础类型都是可序列化的)
Some flash.* classes are also good for serialization (ByteArray, BitmapData).
有些flash.*下面的类用来序列化都是不赖的

翻译的不一定对,呵呵

以前遇到过ByteArray.writeObject()失效的情况,呵呵
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值