Hi;
I'm sure this exists somewhere in the code but I couldn't find it.
Is there a method to convert a byte[] to a ubyte[]?
thanks - dave
See JSharpConvert class.It is done like the following.
public static ubyte[] toUByteArray(byte[] array) { if (array == null) return (ubyte[])null; ubyte[] ubyteArray = new ubyte[array.length]; System.Buffer.BlockCopy(array, 0, ubyteArray, 0, array.length); return ubyteArray; }
Log in to post a comment.
Hi;
I'm sure this exists somewhere in the code but I couldn't find it.
Is there a method to convert a byte[] to a ubyte[]?
thanks - dave
See JSharpConvert class.It is done like the following.
public static ubyte[] toUByteArray(byte[] array)
{
if (array == null) return (ubyte[])null;
ubyte[] ubyteArray = new ubyte[array.length];
System.Buffer.BlockCopy(array, 0, ubyteArray, 0, array.length);
return ubyteArray;
}