If you don’t have a way to serialize all of your data types you won’t be able 
to restore them later.  You’ll need to registerClassAlias for everything or use 
IExternaizable.  Either way you should then be able to see how many bytes that 
is.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: [email protected] [mailto:[email protected]] On Behalf 
Of Sefi Ninio
Sent: Wednesday, September 30, 2009 5:22 AM
To: [email protected]
Subject: [flexcoders] Size of object in bytes


Hello!

I am implementing a Cache functionality for a project I am working on, and one 
of the requirements is to limit the cache size to a specific amount (say 10MB).
To do this, I need to know the size in bytes (or similar) of each cached item.

I know it can be done using ByteArray, but it doesn't work for me.
It requires the cached item to have the [RemoteClass] metatag, since it's using 
AMF to serialize the Object. I can't rely on every cached item having that 
metatag and it's an unrealistic requirement.

Anyone have any ideas on how this can be accomplished?

Thanks,
Sefi

Reply via email to