Yes, you can.
Since both byte
and sbyte
have the same binary representation there's no need to copy the data.
Just do a cast to Array, then cast it to byte[]
and it'll be enough.
sbyte[] signed = { -2, -1, 0, 1, 2 };
byte[] unsigned = (byte[]) (Array)signed;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…