So I was wondering why this Blob
object has a size
of 5:
var x = new Uint8Array(2);
x[0] = 255;
x[1] = 10;
console.log("Typed array length is " + x.length + ".")
console.log("Typed array byte length is " + x.byteLength + ".")
console.log("Blob size is " + new Blob(x).size + ' "bytes".')
For me it makes no sense, because an Uint8Array
element can be stored inside a byte. (Uint8Array
items can handle a value from 0 to 255.)
Also, changing x[0]
or x[1]
seems to change new Blob(x).size
. x.byteLength
, however, gives the expected result to me.
I can't find any explanation for this, even though I've searched everywhere.