public static JSArrayInteger UBytesToJSArray(byte[] data) { JSArrayInteger jsan = (JSArrayInteger)Script.Literal("[]"); int length = data.Length; for (int index = length - 1; index >= 0; index--) { jsan.Set(index, data[index] & 255); } return(jsan); }
public static JSArrayInteger UInt16ToJSArray(short[] data) { JSArrayInteger jsan = (JSArrayInteger)Script.Literal("[]"); int length = data.Length; for (int index = length - 1; index >= 0; index--) { jsan.Set(index, data[index] & 65535); } return(jsan); }