You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

后台工作线程设置ApplicationDomain#domainMemory时触发Error #1504错误

问题:Base64解码时赋值domainMemory触发Error #1504?

我在测试Base64数据解码,在后台工作线程中通过ApplicationDomain#domainMemory高效读取数据:

override public function decode(): Array {
    ...
    ApplicationDomain.currentDomain.domainMemory = task.input;
    ...
}

当将从主线程接收的16字节task.input赋值给domainMemory时,恰好触发了「文件结束」错误:

Error #1504: End of file.

测试功能类似的encode()函数时,未出现此类错误。

最小复现示例(MCVE)

执行run/test脚本即可复现,需满足以下依赖:

  • Node.js
  • asconfigc

核心测试代码如下:

package {
    import flash.display.Sprite;
    import org.agera.crypto.*;
    import org.agera.util.*;

    public class Main extends Sprite {
        public function Main() {
            encrypt("Some string", EncryptionFormat.BASE_64)
                .then(function(data: String): void {
                    assertEquals(data, "U29tZSBzdHJpbmc=");
                    trace("Base-64 encryption .. OK");
                })
                .otherwise(function(error: Error): void {
                    trace("Base-64 encryption .. ERROR");
                });
            decrypt("U29tZSBzdHJpbmc=", EncryptionFormat.BASE_64)
                .then(function(data: String): void {
                    assertEquals(data, "Some string");
                    trace("Base-64 decryption .. OK");
                })
                .otherwise(function(error: Error): void {
                    trace(error.message);
                    trace("Base-64 decryption .. ERROR");
                });
        }
    }
}

内容的提问来源于stack exchange,提问作者Hydroper

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.03 01:32:06