Could anyone help me out with reading from the InputStream? Whenever I receive the data and put it into a buffer, the elements in it seems to be inconsistent. For example I am expecting a buffer of [0,0,0,0,0,0,4,3,0]. sometimes I get the right values sometimes I get [0,0,0,0,0,0,3,0,0], or [0,0,0,0,0,0,0,3,4] or some different variation.
I am not entirely sure if there is not enough time to update the buffer properly before it is being evaluated or if there is some other problem.
This is being done within a
run()
function of a thread
Its like the app is receiving the data from the inputstream consistently. It always varies
Seems to be a problem when the number of bytes > ~6 for some reason?