Possible Duplicate:
Can’t convert value type array to params object[]
Why is
object h = new byte();
possible and
object[] h = new byte[5];
is not?
How to cast a byte Array to an object Array?
Thank You!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The first example boxes a single value.
In the second example, you’re trying to convert a whole array. That just doesn’t work. Each element of an
objectarray is anobjectvariable. Each element of abytearray is abytevariable. They don’t share a representation – you just can’t do it.You can create a new object array from a byte array easily enough, e.g.
… but you can’t treat the byte array as if it were an object array.
Alternatively, you can use the
System.Arraytype, which is compatible withbyte[]. Does that help you?