serializer._getSharedArrayBufferId(sharedArrayBuffer)


当序列化机制将要序列化一个ShareArrayBuffer对象时会调用此方法。它必须为这对象返回一个32位无符号整型的ID,但若这个对象已被序列化过,则返回上一次序列化时所分配的ID。这个ID会在对象被反序列化时传入deserializer.transferArrayBuffer()中。

如果对象不能被序列化,则抛出异常。

Serializer类本身不包含此方法,但可以在其子类中设置它。

This method is called when the serializer is going to serialize a SharedArrayBuffer object. It must return an unsigned 32-bit integer ID for the object, using the same ID if this SharedArrayBuffer has already been serialized. When deserializing, this ID will be passed to deserializer.transferArrayBuffer().

If the object cannot be serialized, an exception should be thrown.

This method is not present on the Serializer class itself but can be provided by subclasses.