What type is System.Byte[*]
I'm being passed an object that returns "System.Byte[*]" when converted to string. This apparently isn't a standard one dimensional array of Byte objects (开发者_开发问答"System.Byte[]"), so what is it?
That's probably a single-dimensional array with a non-zero base.
Here's an example of how to create one:
using System;
class Test
{
static void Main()
{
Array nonZeroBase = Array.CreateInstance
(typeof(byte), new int[]{1}, new int[]{2});
Console.WriteLine(nonZeroBase); // Prints byte[*]
}
}
In CLR terminology this is called an array (rectangular arrays are also arrays) where single-dimensional, zero-based arrays are called vectors. (A multi-dimensional array would be printed as byte[,]
though.)
You may be interested in this blog post which Marc Gravell posted just morning...
There is no ...[*]
type in c# as far as I remember. Maybe you can find the API documentation for that library, that will show you what the type is really. Even if you don't have that, Visual Studio should show you the type when you try autocompletion on the method returning the object.
精彩评论