Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>As per the final sentence of the AMF3 specification (<a href="http://opensource.adobe.com/wiki/download/attachments/1114283/amf3_spec_05_05_08.pdf" rel="nofollow noreferrer" title="AMF 3.0 Spec at Adobe.com">AMF 3.0 Spec at Adobe.com</a>):</p> <blockquote> <p>Also note that ByteArray uses a new set of implicit reference tables for objects, object traits and strings for each readObject and writeObject call.</p> </blockquote> <p>It appears that the intention with ByteArray.writeObject is to create a serialization which could be stored or recovered on a per-object basis.</p> <p>The NetConnection object's behavior is similar to what you had hoped for.</p> <p>When updating the string-references table, it is important to not add empty strings to the reference table.</p> <p>When maintaining the object-references table, you may be able to implement defensive programming as follows: the object-references table is constructed recursively and at some times contains objects for which the traits are not yet completely known. If the table indices are not allocated in advance, the numbering will be inconsistent across applications. An AMF3 decoder should not use the traits from a partially-constructed object -- such input should be flagged as erroneous.</p> <p>The strings-reference table is implemented at the encoder by 'tagging' in-memory string objects as they are serialized. Encoding two different string objects with the same content (matching strings) do not seem to be encoded with one string referencing the other. Both strings will be output and a string-by-reference will not be used.</p> <p>There may be a solution to your original question. If you have a number of objects all belonging to the same class, and you would like to store those objects all in one storage, I suggest the following: Create a "parent object" with references to all the objects you intend to store. Then use ByteArray.writeObject to persist that parent object. AMF will encode all of the referenced objects and will represent the traits of repeated object classes in an efficient way.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload