如何在 C# 中声明 byte[] 以便 IronPython 将其解释为 byte[] 而不是元组

发布于 2024-08-19 13:37:59 字数 492 浏览 3 评论 0原文

在 C++/CLI 中,我们有一个返回此值的函数:

array<Byte>^ OutBuffer = gcnew array<Byte>(BufferSize);

IronPython 将其视为 byte[]

在 C# 中,我们有一个返回此值的函数:

OutBuffer = new Byte[InBuffer.Length];

虽然 C# 客户端将 Outbuffer 视为 byte[],但 IronPython 将其视为包含多个数组的元组。

我们如何使 IronPython 将 OutBuffer 作为 byte[] 而不是作为元组关联?

为什么 C# 和 C++/CLI 之间存在差异?

编辑:这个问题已提出并显然已经解决,但没有提供答案。这可以纠正吗?

In a C++/CLI we have a function that returns this:

array<Byte>^ OutBuffer = gcnew array<Byte>(BufferSize);

IronPython treats it as a byte[].

In C#, we have a function that returns this:

OutBuffer = new Byte[InBuffer.Length];

While a C# client treats Outbuffer as a byte[], IronPython treats it as a tuple containing multiple arrays.

How do we make IronPython relate to OutBuffer as a byte[] and not as a tuple?

Why the discrepancy between the C# and C++/CLI?

EDIT: This question is posed and apparently solved, but no answer supplied. Can this be corrected?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文