From 7d40c2f1960bbe8a37c44cb82c9150da46f7eea6 Mon Sep 17 00:00:00 2001 From: yihuiyang Date: Thu, 2 Nov 2023 16:16:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E8=81=94=E9=97=AE=E9=A2=98=E5=8D=9550?= =?UTF-8?q?64=E3=80=815199,=E8=A7=A3=E5=86=B3=E6=95=B0=E6=8D=AE=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=A0=BC=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yihuiyang --- .../src/main/ets/plugin/common/StandardMessageCodec.ets | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/StandardMessageCodec.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/StandardMessageCodec.ets index 184ff352b3..6e8a398334 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/StandardMessageCodec.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/StandardMessageCodec.ets @@ -105,7 +105,7 @@ export default class StandardMessageCodec implements MessageCodec { if (-0x7fffffff - 1 <= value && value <= 0x7fffffff) { //int32 stream.writeInt8(StandardMessageCodec.INT32) stream.writeInt32(value, true) - } else if(-0x7fffffffffffffff - 1 <= value && value <= 0x7fffffffffffffff) { //int64 + } else if(Number.MIN_SAFE_INTEGER <= value && value <= Number.MAX_SAFE_INTEGER) { //int64 number整型取值范围 stream.writeInt8(StandardMessageCodec.INT64) stream.writeBigInt64(BigInt(value), true) } else { //被判为整型的double型 @@ -148,7 +148,8 @@ export default class StandardMessageCodec implements MessageCodec { this.writeSize(stream, value.length); this.writeAlignment(stream, 8); value.forEach(item => stream.writeFloat64(item, true)) - } else if (value instanceof Array) { + } else if (value instanceof Array || value instanceof Int8Array || value instanceof Int16Array ++ || value instanceof Uint16Array || value instanceof Uint32Array) { stream.writeInt8(StandardMessageCodec.LIST) this.writeSize(stream, value.length); value.forEach((item: ESObject): void => this.writeValue(stream, item)) -- Gitee