![](/img/trans.png)
[英]What does the type System.Byte[*] mean and can I cast it to a byte[] without copying?
[英]What type is System.Byte[*]
我正在传递一个对象,当转换为字符串时返回“System.Byte [*]”。 这显然不是Byte对象的标准一维数组(“System.Byte []”),那么它是什么?
这可能是一个非零基数的单维数组。
以下是如何创建一个示例:
using System;
class Test
{
static void Main()
{
Array nonZeroBase = Array.CreateInstance
(typeof(byte), new int[]{1}, new int[]{2});
Console.WriteLine(nonZeroBase); // Prints byte[*]
}
}
在CLR术语中,这称为数组 (矩形数组也是数组),其中一维的,从零开始的数组称为向量 。 (虽然多维数组将打印为byte[,]
。)
您可能对Marc Gravell上午发布的博客文章感兴趣...
据我记得,c#中没有...[*]
类型。 也许您可以找到该库的API文档,它将向您显示该类型的真实内容。 即使您没有这样,Visual Studio也应该在返回对象的方法上尝试自动完成时显示类型。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.