I have to process a JS Uint8ClampedArray
. When I print the full array with document.write(data)
the result is fine, but when I access to the first item document.write(data[0])
the result is some undefined and wrong numbers.
The array is created like this:
var myArray = new ArrayBuffer(imgData.data.length);
var data = new Uint8ClampedArray(myArray);
data=httpRequest.responseText;
The information comes from a C cgi program which prints binary data this way:
for(int i = 0; i<len; i++)
printf("%u", input[i]);