serializer._getSharedArrayBufferId(sharedArrayBuffer)


此方法在序列化器要序列化 SharedArrayBuffer 对象时被调用。 它必须为对象返回无符号的 32 位整数 ID,如果此 SharedArrayBuffer 已被序列化,则使用相同的 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.