• In JavaScript?

    It seems I got the endianness wrong, so you can't just do: new Int16Array((new Uint8Array([235, 250,5, 9,253, 21])).buffer)

    Instead you need:

    var a = [235, 250,5, 9,253, 21];
    var d = [(a[0]<<8)|a[1], (a[2]<<8)|a[3], (a[4]<<8)|a[5]];
    for (var i=0;i<3;i++) if (d[i]&32768) d[i]-=65536;
    // results in d
    

    I guess you're using Java in Android - that code should be pretty easy to convert.

    There are other ways of converting numbers from byte arrays (utilities in various different languages), but the code above is pretty universal.

About

Avatar for Gordon @Gordon started